From 595b8c7a015b8c41a8180c8d08b1a0a2cdb89ecd Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 16 May 2017 21:34:25 +1000 Subject: [PATCH] For safety, restore previous behaviour (but only loop once) --- qcsrc/server/race.qc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 2668c3c89..31edbc3f0 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -621,6 +621,15 @@ void checkpoint_passed(entity this, entity player) cp_amount += 1; if(it.race_checkpoint > largest_cp_id) // update the finish id if someone hit a new checkpoint { + if(!largest_cp_id) + { + IL_EACH(g_race_targets, it.classname == "target_checkpoint", + { + if(it.race_checkpoint == -2) // set defragcpexists to -1 so that the cp id file will be rewritten when someone finishes + defragcpexists = -1; + }); + } + largest_cp_id = it.race_checkpoint; IL_EACH(g_race_targets, it.classname == "target_stopTimer", { @@ -629,9 +638,6 @@ void checkpoint_passed(entity this, entity player) race_highest_checkpoint = largest_cp_id + 1; race_timed_checkpoint = largest_cp_id + 1; } - - if(it.race_checkpoint == -2) // set defragcpexists to -1 so that the cp id file will be rewritten when someone finishes - defragcpexists = -1; }); if(!cp_amount) -- 2.39.2