]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If a vehicle is activating a checkpoint, count the owner as passing, fixes race with...
authorMario <mario@smbclan.net>
Wed, 8 May 2019 15:50:37 +0000 (01:50 +1000)
committerMario <mario@smbclan.net>
Wed, 8 May 2019 15:50:37 +0000 (01:50 +1000)
qcsrc/server/race.qc

index 603b32a80c288803f949da637c6ebd32436750e4..350872ce77148f529726459d93c35954ef8140cb 100644 (file)
@@ -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);
 }