]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_laser.qc
Set weapons to fully loaded on respawn in each weapon file instead of cl_client....
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_laser.qc
index 0e23c6b401999c73f9b77bad417bc2c1afc6fa2e..222feb1c56a3261dc4c1899195bd64e5764411c2 100644 (file)
@@ -4,8 +4,6 @@ REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_
 #ifdef SVQC
 void(float imp) W_SwitchWeapon;
 
-.float laser_load;
-
 void W_Laser_SetAmmoCounter()
 {
        // set clip_load to the weapon we have switched to, if the gun uses reloading
@@ -319,17 +317,6 @@ float w_laser(float req)
                                        W_SwitchWeapon (self.cnt);
                        }
                }
-        if(self.wish_reload)
-        {
-            if(self.switchweapon == self.weapon)
-            {
-                if(self.weaponentity.state == WS_READY)
-                {
-                    self.wish_reload = 0;
-                    W_Laser_Reload();
-                }
-            }
-        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -346,11 +333,22 @@ float w_laser(float req)
                W_Laser_SetAmmoCounter();
        }
        else if (req == WR_CHECKAMMO1)
+       {
                return TRUE;
+       }
        else if (req == WR_CHECKAMMO2)
+       {
                return TRUE;
+       }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.laser_load = autocvar_g_balance_laser_reload_ammo;
+       }
        else if (req == WR_RELOAD)
+       {
                W_Laser_Reload();
+       }
        return TRUE;
 };
 #endif