From 91bb936ebb98abee22058ffe15b3890acc74327f Mon Sep 17 00:00:00 2001 From: jenzur Date: Fri, 26 Jun 2020 12:30:19 +0200 Subject: [PATCH] small fix hopefully to error being spammed --- RaceTimer/scripting/unloze_racetimer_specialmaps.sp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RaceTimer/scripting/unloze_racetimer_specialmaps.sp b/RaceTimer/scripting/unloze_racetimer_specialmaps.sp index 39a83999..e110a81e 100644 --- a/RaceTimer/scripting/unloze_racetimer_specialmaps.sp +++ b/RaceTimer/scripting/unloze_racetimer_specialmaps.sp @@ -51,6 +51,8 @@ public int Native_Isspecialmap(Handle handler, int numParams) public int GetCurrentStage() { int iLevelCounterEnt = FindEntityByTargetname(INVALID_ENT_REFERENCE, "Level_Counter", "math_counter"); + if (iLevelCounterEnt == -1) + return 0; int offset = FindDataMapInfo(iLevelCounterEnt, "m_OutValue"); int iCounterVal = RoundFloat(GetEntDataFloat(iLevelCounterEnt, offset)); return iCounterVal;