From: Mario Date: Sat, 11 May 2019 07:30:22 +0000 (+1000) Subject: Move vehicle check to the checkpoint_passed function (slight cleanup) X-Git-Tag: xonotic-v0.8.5~1504 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=834b48a199646933fcea035a0d8a5bae16d56622;p=xonotic%2Fxonotic-data.pk3dir.git Move vehicle check to the checkpoint_passed function (slight cleanup) --- diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 775053e02..b3241838b 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -567,6 +567,9 @@ void race_ClearTime(entity e) void checkpoint_passed(entity this, entity player) { + if(IS_VEHICLE(player) && player.owner) + player = player.owner; + if(player.personal && autocvar_g_allow_checkpoints) return; // practice mode! @@ -716,8 +719,6 @@ 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); } @@ -726,8 +727,6 @@ 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); }