]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_damage.qc
Convert some floats into ints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_damage.qc
index d561862d0f2412e77f4f55f851d969f4ef1cbded..43567fcbfcb48c0442a8090bbd9d4178560c9830 100644 (file)
@@ -22,8 +22,6 @@ void turret_stdproc_die()
     self.takedamage             = DAMAGE_NO;
 
     self.health             = 0;
-       
-       MUTATOR_CALLHOOK(TurretDies);
 
 // Go boom
     //RadiusDamage (self,self, min(self.ammo,50),min(self.ammo,50) * 0.25,250,world,min(self.ammo,50)*5,DEATH_TURRET,world);
@@ -42,7 +40,7 @@ void turret_stdproc_die()
         self.SendFlags      |= TNSF_STATUS;
         self.nextthink      = time + 0.2;
         self.think          = turret_hide;
-        
+
         if (self.turret_diehook)
             self.turret_diehook();
     }
@@ -54,11 +52,11 @@ void turret_stdproc_respawn()
     // this function doubles as "teamchange" function.
     self.tur_head.team         = self.team;
 
-    self.effects             &~= EF_NODRAW;
+    self.effects             &= ~EF_NODRAW;
     self.deadflag           = DEAD_NO;
     self.effects            = EF_LOWPRECISION;
     self.solid              = SOLID_BBOX;
-    
+
     self.takedamage                    = DAMAGE_AIM;
     self.event_damage           = turret_stdproc_damage;
 
@@ -66,7 +64,6 @@ void turret_stdproc_respawn()
     self.tur_head.avelocity     = self.avelocity;
     self.tur_head.angles        = self.idle_aim;
     self.health                 = self.tur_health;
-       self.max_health                         = self.tur_health;
 
     self.enemy                  = world;
     self.volly_counter          = self.shot_volly;
@@ -74,7 +71,7 @@ void turret_stdproc_respawn()
 
     self.nextthink  = time + self.ticrate;
     self.think      = turret_think;
-    
+
     self.SendFlags  = TNSF_FULL_UPDATE;
 
     if (self.turret_respawnhook)
@@ -84,14 +81,14 @@ void turret_stdproc_respawn()
 /*
 * Standard damage proc.
 */
-void turret_stdproc_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+void turret_stdproc_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
 {
     // Enougth allready!
     if(self.deadflag == DEAD_DEAD)
         return;
 
     // Inactive turrets take no damage. (hm..)
-    if not (self.active)
+    if (!self.active)
         return;
 
     if (teamplay)
@@ -112,15 +109,15 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     // thorw head slightly off aim when hit?
     if (self.damage_flags & TFL_DMG_HEADSHAKE)
     {
-        self.tur_head.angles_x = self.tur_head.angles_x + (-0.5 + random()) * damage;
-        self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage;
-        
+        self.tur_head.angles_x = self.tur_head.angles.x + (-0.5 + random()) * damage;
+        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)
         self.velocity = self.velocity + vforce;
-    
+
     if (self.health <= 0)
     {
         self.event_damage           = func_null;
@@ -129,6 +126,6 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
         self.nextthink = time;
         self.think = turret_stdproc_die;
     }
-    
+
     self.SendFlags  |= TNSF_STATUS;
 }