From c4e0c3f1fa4102e0661ac0f6df10e28159bea595 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 21 Jul 2017 05:21:25 +1000 Subject: [PATCH] Potential fix for crazy amount of race checkpoint waypoints on some maps --- qcsrc/server/race.qc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 03c4fa828..a96253297 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -812,8 +812,10 @@ void trigger_race_checkpoint_verify(entity this) g_race_qualifying = qual; - IL_EACH(g_race_targets, true, + IL_EACH(g_race_targets, it.classname == "target_checkpoint" || it.classname == "target_startTimer" || it.classname == "target_stopTimer", { + if(it.targetname == "" || !it.targetname) // somehow this is a case... + continue; entity cpt = it; FOREACH_ENTITY_STRING(target, cpt.targetname, { @@ -830,12 +832,15 @@ void trigger_race_checkpoint_verify(entity this) if (race_timed_checkpoint) { if (defrag_ents) { - IL_EACH(g_race_targets, true, + IL_EACH(g_race_targets, it.classname == "target_checkpoint" || it.classname == "target_startTimer" || it.classname == "target_stopTimer", { entity cpt = it; if(it.classname == "target_startTimer" || it.classname == "target_stopTimer") { + if(it.targetname == "" || !it.targetname) // somehow this is a case... + continue; FOREACH_ENTITY_STRING(target, cpt.targetname, { - WaypointSprite_UpdateSprites(it.sprite, ((cpt.classname == "target_startTimer") ? WP_RaceStart : WP_RaceFinish), WP_Null, WP_Null); + if(it.sprite) + WaypointSprite_UpdateSprites(it.sprite, ((cpt.classname == "target_startTimer") ? WP_RaceStart : WP_RaceFinish), WP_Null, WP_Null); }); } if(it.classname == "target_checkpoint") { -- 2.39.2