]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent a potential crash with vehicles and bloodloss
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 11:49:46 +0000 (21:49 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 11:49:46 +0000 (21:49 +1000)
qcsrc/server/mutators/mutator_bloodloss.qc

index eb179a0c8c8499b73dba3c150a985d21b26280d8..d68ff388f8583ae472366f513232a097e4bbb37e 100644 (file)
@@ -13,7 +13,10 @@ MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink)
 
                if(time >= self.bloodloss_timer)
                {
-                       self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
+                       if(self.vehicle)
+                               vehicles_exit(VHEF_RELEASE);
+                       if(self.event_damage)
+                               self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
                        self.bloodloss_timer = time + 0.5 + random() * 0.5;
                }
        }