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 61b5add..6686fb6 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...