]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Eject the player from their vehicle before killing them (fixes a crash when shuffling...
authorMario <mario.mario@y7mail.com>
Tue, 10 Sep 2013 06:04:26 +0000 (16:04 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 10 Sep 2013 06:04:26 +0000 (16:04 +1000)
qcsrc/server/g_damage.qc

index 61b5add2bbd3b0e9a5bb47109add2f574cb62df6..6686fb695560baa87c94f785972f74393421311a 100644 (file)
@@ -588,6 +588,10 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 
        if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
        {
+               // exit the vehicle before killing (fixes a crash)
+               if(IS_PLAYER(targ) && targ.vehicle)
+                       vehicles_exit(VHEF_RELESE);
+       
                // These are ALWAYS lethal
                // No damage modification here
                // Instead, prepare the victim for his death...