]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/vehicles/vehicles.qc
Add a few quick checks to ensure dead/frozen players don't enter vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / vehicles / vehicles.qc
index b9740b5d88bfa5bee49fc6589962ef61298ed672..9042bd4e810be0b9382d845ee99dd49902a9bfda 100644 (file)
@@ -608,6 +608,12 @@ void vehicles_enter()
 
     if(self.phase > time)
         return;
+    if(other.frozen)
+        return;
+    if(other.vehicle)
+        return;
+    if(other.deadflag != DEAD_NO)
+        return;
 
     if(teamplay)
     if(self.team)
@@ -661,6 +667,7 @@ void vehicles_enter()
 
     self.team                 = self.owner.team;
     self.flags               -= FL_NOTARGET;
+    self.monster_attack       = TRUE;
 
     if (IS_REAL_CLIENT(other))
     {
@@ -838,6 +845,7 @@ void vehicles_exit(float eject)
     sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
     _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
     _vehicle.phase = time + 1;
+    _vehicle.monster_attack = FALSE;
 
     _vehicle.vehicle_exit(eject);