]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_main.qc
Merge remote branch 'origin/fruitiex/glowmodreset'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_main.qc
index 1b2fcd7723b8089c7fb5102dbb44f424eb4c7e66..4a2e886af863bdca739e41c43786dc5f684bc5ab 100644 (file)
@@ -340,8 +340,9 @@ float turret_stdproc_firecheck()
 
     // Special case: volly fire turret that has to fire a full volly if a shot was fired.
     if (self.shoot_flags & TFL_SHOOT_VOLLYALWAYS)
-        if not (self.volly_counter == self.shot_volly)
-            return 1;
+        if (self.volly_counter != self.shot_volly)
+                       if(self.ammo >= self.shot_dmg)
+                               return 1;               
 
     // Lack of zombies makes shooting dead things unnecessary :P
     if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
@@ -608,7 +609,7 @@ void turret_think()
     self.nextthink = time + self.ticrate;
 
     // ONS uses somewhat backwards linking.
-    if (teamplay)
+    if (teams_matter)
     {
         if not (g_onslaught)
             if (self.target)
@@ -717,7 +718,7 @@ void turret_think()
 
         // g_turrets_targetscan_maxdelay forces a target re-scan at least this often
         float do_target_scan;
-        if((self.target_select_time + cvar("g_turrets_targetscan_maxdelay")) < time)
+        if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
             do_target_scan = 1;
 
         // Old target (if any) invalid?
@@ -728,7 +729,7 @@ void turret_think()
         }
 
         // But never more often then g_turrets_targetscan_mindelay!
-        if (self.target_select_time + cvar("g_turrets_targetscan_mindelay") > time)
+        if (self.target_select_time + autocvar_g_turrets_targetscan_mindelay > time)
             do_target_scan = 0;
 
         if(do_target_scan)
@@ -752,7 +753,7 @@ void turret_think()
             return;
         }
         else
-            self.lip = time + cvar("g_turrets_aimidle_delay"); // Keep track of the last time we had a target.
+            self.lip = time + autocvar_g_turrets_aimidle_delay; // Keep track of the last time we had a target.
 
         // Predict?
         if not(self.aim_flags & TFL_AIM_NO)
@@ -776,7 +777,7 @@ void turret_think()
 
 void turret_fire()
 {
-    if (cvar("g_turrets_nofire") != 0)
+    if (autocvar_g_turrets_nofire != 0)
         return;
 
     self.turret_firefunc();
@@ -835,7 +836,7 @@ void turrets_manager_think()
     self.nextthink = time + 1;
 
     entity e;
-    if (cvar("g_turrets_reloadcvars") == 1)
+    if (autocvar_g_turrets_reloadcvars == 1)
     {
         e = nextent(world);
         while (e)
@@ -863,7 +864,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
        entity e, ee;
 
     // Are turrets allowed?
-    if (cvar("g_turrets") == 0)
+    if (autocvar_g_turrets == 0)
         return 0;
 
 
@@ -912,12 +913,12 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
     load_unit_settings(self,self.cvar_basename, 0);
 
     // Handle turret teams.
-    if (cvar("g_assault") != 0)
+    if (autocvar_g_assault != 0)
     {
         if not (self.team)
             self.team = 14; // Assume turrets are on the defending side if not explicitly set otehrwize
     }
-    else if not (teamplay)
+    else if not (teams_matter)
                self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team, so they dont kill eachother.
        else if(g_onslaught && self.targetname)
        {
@@ -1234,6 +1235,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
         self.use();
     }
 
+       turret_stdproc_respawn();
     return 1;
 }