]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move vehicle check to the checkpoint_passed function (slight cleanup)
authorMario <mario@smbclan.net>
Sat, 11 May 2019 07:30:22 +0000 (17:30 +1000)
committerMario <mario@smbclan.net>
Sat, 11 May 2019 07:30:22 +0000 (17:30 +1000)
qcsrc/server/race.qc

index 775053e02b7ae3d8cd6413f271b70e885d931b24..b3241838b039ef1523703f759856d86053e8c0b8 100644 (file)
@@ -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);
 }