From: Des Date: Thu, 10 Oct 2024 13:44:45 +0000 (-0300) Subject: target_checkpoints with duplicate targetname get same cp number(order) to be tolerant... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=76de16cf5a25a107b2bcc26e81b04f7d00d2695e;p=xonotic%2Fxonotic-data.pk3dir.git target_checkpoints with duplicate targetname get same cp number(order) to be tolerant of bugged maps --- 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;