From: Mario Date: Wed, 8 May 2019 15:50:37 +0000 (+1000) Subject: If a vehicle is activating a checkpoint, count the owner as passing, fixes race with... X-Git-Tag: xonotic-v0.8.5~1507 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=df01df98d6d2839cf4592c702c599a9c3ee3db2b;p=xonotic%2Fxonotic-data.pk3dir.git If a vehicle is activating a checkpoint, count the owner as passing, fixes race with vehicles --- diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 603b32a80..350872ce7 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -715,6 +715,8 @@ void checkpoint_passed(entity this, entity player) void checkpoint_touch(entity this, entity toucher) { EXACTTRIGGER_TOUCH(this, toucher); + if(IS_VEHICLE(toucher) && toucher.owner) + toucher = toucher.owner; checkpoint_passed(this, toucher); } @@ -723,6 +725,8 @@ void checkpoint_use(entity this, entity actor, entity trigger) if(trigger.classname == "info_player_deathmatch") // a spawn, a spawn return; + if(IS_VEHICLE(actor) && actor.owner) + actor = actor.owner; checkpoint_passed(this, actor); }