]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_damage.qc
Merge branch 'master' into terencehill/itemstime
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_damage.qc
index 88358e771e3c2392fb63a2d5ddd3a023bc74bd7d..971d65cca3916eea9f99a17d28b5d41ee096211f 100644 (file)
@@ -18,7 +18,7 @@ void turret_stdproc_die()
     self.solid              = SOLID_NOT;
     self.tur_head.solid     = self.solid;
 
-    self.event_damage           = SUB_Null;
+    self.event_damage           = func_null;
     self.takedamage             = DAMAGE_NO;
 
     self.health             = 0;
@@ -84,11 +84,11 @@ void turret_stdproc_respawn()
 void turret_stdproc_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
 {
     // Enougth allready!
-    if (self.health <= 0)
+    if(self.deadflag == DEAD_DEAD)
         return;
 
     // Inactive turrets take no damage. (hm..)
-    if not (self.tur_active)
+    if not (self.active)
         return;
 
     if (teamplay)
@@ -113,7 +113,6 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
         self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage;
         
         self.SendFlags  |= TNSF_ANG;
-
     }
 
     if (self.turrcaps_flags & TFL_TURRCAPS_MOVE)
@@ -121,8 +120,8 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     
     if (self.health <= 0)
     {
-        self.event_damage           = SUB_Null;
-        self.tur_head.event_damage  = SUB_Null;
+        self.event_damage           = func_null;
+        self.tur_head.event_damage  = func_null;
         self.takedamage             = DAMAGE_NO;
         self.nextthink = time;
         self.think = turret_stdproc_die;