From 834b48a199646933fcea035a0d8a5bae16d56622 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 11 May 2019 17:30:22 +1000 Subject: [PATCH] Move vehicle check to the checkpoint_passed function (slight cleanup) --- qcsrc/server/race.qc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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); } -- 2.39.2