From: Mario Date: Thu, 20 Jul 2017 19:21:25 +0000 (+1000) Subject: Potential fix for crazy amount of race checkpoint waypoints on some maps X-Git-Tag: xonotic-v0.8.5~2559 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;ds=sidebyside;h=c4e0c3f1fa4102e0661ac0f6df10e28159bea595;p=xonotic%2Fxonotic-data.pk3dir.git Potential fix for crazy amount of race checkpoint waypoints on some maps --- 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") {