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;