From 76de16cf5a25a107b2bcc26e81b04f7d00d2695e Mon Sep 17 00:00:00 2001 From: Des Date: Thu, 10 Oct 2024 10:44:45 -0300 Subject: [PATCH] target_checkpoints with duplicate targetname get same cp number(order) to be tolerant of bugged maps --- qcsrc/server/race.qc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 078f9e192..ee68144ae 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -713,7 +713,13 @@ void checkpoint_passed(entity this, entity player) { if(this.race_checkpoint == -2) { - this.race_checkpoint = player.race_checkpoint; + // duplicate targetname target_checkpoints get the same cp nr + IL_EACH(g_race_targets, it.classname == "target_checkpoint" && it.targetname == this.targetname, { + if(it.race_checkpoint >= 0) + this.race_checkpoint = it.race_checkpoint; + }); + if(this.race_checkpoint == -2) + this.race_checkpoint = player.race_checkpoint; } int cp_amount = 0, largest_cp_id = 0; -- 2.39.2