]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_hagar.qc
Move load persistence floats back to their weapon files. That should be the last...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_hagar.qc
index f16183021d36cec19bb6e928f47c9c50d1e9bcf7..e982c3a213718828b3986f302074a12ff4c2d0b8 100644 (file)
@@ -4,6 +4,9 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLI
 #ifdef SVQC
 // NO bounce protection, as bounces are limited!
 
+// weapon load persistence, for weapons that support reloading
+.float hagar_load;
+
 void W_Hagar_SetAmmoCounter()
 {
        // set clip_load to the weapon we have switched to, if the gun uses reloading
@@ -220,17 +223,6 @@ float w_hagar(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready);
                        }
                }
-        if(self.wish_reload)
-        {
-            if(self.switchweapon == self.weapon)
-            {
-                if(self.weaponentity.state == WS_READY)
-                {
-                    self.wish_reload = 0;
-                    W_Hagar_Reload();
-                }
-            }
-        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -257,6 +249,11 @@ float w_hagar(float req)
                ammo_amount += (autocvar_g_balance_hagar_reload_ammo && self.hagar_load >= autocvar_g_balance_hagar_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.hagar_load = autocvar_g_balance_hagar_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_Hagar_Reload();