]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_main.qc
Convert a load more floats into ints and bools
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_main.qc
index 28d2ae29cbe7dff7de2ec02f53af029ffece298b..ad0b68521bb4c03f46991e3cc331e37ea7740cd5 100644 (file)
@@ -15,7 +15,7 @@ void turrets_setframe(float _frame, float client_only)
 
 }
 
-float turret_send(entity to, float sf)
+float turret_send(entity to, int sf)
 {
 
        WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET);
@@ -163,7 +163,7 @@ void turret_projectile_touch()
     turret_projectile_explode();
 }
 
-void turret_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+void turret_projectile_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
 {
     self.velocity  += vforce;
     self.health    -= damage;
@@ -387,15 +387,15 @@ void turret_stdproc_track()
 
         case TFL_TRACKTYPE_FLUIDINERTIA:
             f_tmp = self.aim_speed * self.ticrate; // dgr/sec -> dgr/tic
-            move_angle_x = bound(-self.aim_speed, move_angle.x * self.track_accel_pitch * f_tmp, self.aim_speed);
-            move_angle_y = bound(-self.aim_speed, move_angle.y * self.track_accel_rot * f_tmp, self.aim_speed);
+            move_angle.x = bound(-self.aim_speed, move_angle.x * self.track_accel_pitch * f_tmp, self.aim_speed);
+            move_angle.y = bound(-self.aim_speed, move_angle.y * self.track_accel_rot * f_tmp, self.aim_speed);
             move_angle = (self.tur_head.avelocity * self.track_blendrate) + (move_angle * (1 - self.track_blendrate));
             break;
 
         case TFL_TRACKTYPE_FLUIDPRECISE:
 
-            move_angle_y = bound(-self.aim_speed, move_angle.y, self.aim_speed);
-            move_angle_x = bound(-self.aim_speed, move_angle.x, self.aim_speed);
+            move_angle.y = bound(-self.aim_speed, move_angle.y, self.aim_speed);
+            move_angle.x = bound(-self.aim_speed, move_angle.x, self.aim_speed);
 
             break;
     }
@@ -931,7 +931,7 @@ void turret_think()
 
 void turret_fire()
 {
-    if (autocvar_g_turrets_nofire != 0)
+    if (autocvar_g_turrets_nofire)
         return;
 
     self.turret_firefunc();
@@ -991,7 +991,7 @@ void turrets_manager_think()
     self.nextthink = time + 1;
 
     entity e;
-    if (autocvar_g_turrets_reloadcvars == 1)
+    if (autocvar_g_turrets_reloadcvars)
     {
         e = nextent(world);
         while (e)
@@ -1041,19 +1041,6 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     if (!(self.spawnflags & TSF_SUSPENDED))
         builtin_droptofloor(); // why can't we use regular droptofloor here?
 
-    // Terrainbase spawnflag. This puts a enlongated model
-    // under the turret, so it looks ok on uneaven surfaces.
-    /*  TODO: Handle this with CSQC
-    if (self.spawnflags & TSF_TERRAINBASE)
-    {
-        entity tb;
-        tb = spawn();
-        setmodel(tb,"models/turrets/terrainbase.md3");
-        setorigin(tb,self.origin);
-        tb.solid = SOLID_BBOX;
-    }
-    */
-
     self.cvar_basename = cvar_base_name;
     load_unit_settings(self, self.cvar_basename, 0);