]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove the switchable check and do all checks in the WR_CHECKAMMO checks. Only fixed...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 23 Jan 2011 14:16:18 +0000 (16:16 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 23 Jan 2011 14:16:18 +0000 (16:16 +0200)
21 files changed:
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_porto.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc
qcsrc/server/w_tuba.qc
qcsrc/server/w_uzi.qc

index db53b01810328067a3a47a3de9c3b51a302262ae..864dd77fce788cc1696e7bbdee82ac3309748a89 100644 (file)
@@ -1,6 +1,6 @@
 void W_Reload()
 {
-    weapon_action(self.switchweapon, WR_RELOAD);
+    self.wish_reload = 1;
 }
 
 // switch between weapons
index 5f8d8b0531bd75a57f04d554e966c0ac5d1f44cb..91450dd2b1ae6545a5d42471d03a7923dd7fdb5c 100644 (file)
@@ -925,13 +925,8 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                        {
                                oldself = self;
                                self = cl;
-                               f = weapon_action(wpn, WR_SWITCHABLE);
-
-                               // allow switching to reloadable weapons, even if we're out of ammo, since the weapon itself
-                               // might still be loaded. The reload code takes care of complaining and forced switching
-                               entity e;
-                               e = get_weaponinfo(wpn);
-                               if(wpn != WEP_TUBA && wpn != WEP_PORTO && wpn != WEP_HOOK) // skip non-reloadable weapons, or we access undefined cvars
+                               f = weapon_action(wpn, WR_CHECKAMMO1);
+                               f = f + weapon_action(wpn, WR_CHECKAMMO2);
 
                                // always allow selecting the Mine Layer if we placed mines, so that we can detonate them
                                local entity mine;
@@ -1617,7 +1612,6 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
 #define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread"), FALSE)
 #define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"), FALSE)
 
-// shared weapon reload code
 .float reload_complain;
 float W_ReloadCheck(float ammo_amount, float ammo_shot)
 {
index 10f6763fb530eb199c8394b1edf2c52306abd44f..06d0a3bf5714459a5518c5b90d6c3a12d48e8d45 100644 (file)
@@ -615,6 +615,7 @@ float client_cefc_accumulatortime;
 .float clip_load;
 .float old_clip_load;
 .float clip_size;
+.float wish_reload;
 
 // weapon load persistence, for weapons that support reloading
 .float laser_load;
index 4f3d5ae2392bd627f3773d92ce532c38914f2a05..73f9f5864bba1eae047001469e12ba997d2e8d73 100644 (file)
@@ -650,6 +650,17 @@ float w_crylink(float req)
                                }
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Crylink_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -692,15 +703,6 @@ float w_crylink(float req)
        {
                W_Crylink_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo);
-               return (autocvar_g_balance_crylink_reload_ammo && self.crylink_load >= ammo_amount) || self.ammo_cells >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 247437bc06853735ca1f14bef431d984420e0d95..cd03bdcebe2f74fc3c6409b50117f3b67e22d802 100644 (file)
@@ -525,6 +525,18 @@ float w_electro(float req)
                                }
                        }
                }
+
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Electro_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -579,15 +591,6 @@ float w_electro(float req)
        {
                W_Shotgun_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo);
-               return (autocvar_g_balance_electro_reload_ammo && self.electro_load >= ammo_amount) || self.ammo_cells >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 43764ab5eba4ef4070c3a030d49b153875dcfec1..ea34c80afcdaade523aa24ddbf0c3638271f8729 100644 (file)
@@ -420,6 +420,17 @@ float w_fireball(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_fireball_secondary_animtime, w_ready);
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Fireball_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -459,15 +470,6 @@ float w_fireball(float req)
        {
                W_Fireball_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo);
-               return (autocvar_g_balance_fireball_reload_ammo && self.fireball_load >= ammo_amount) || self.ammo_fuel >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 3817c9ef988f28b5dab20c61b032bcf32e61f8cd..77bf031b3fb25935bba210a3abbe754b57125985 100644 (file)
@@ -388,6 +388,17 @@ float w_glauncher(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_grenadelauncher_secondary_animtime, w_ready);
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_GrenadeLauncher_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -427,15 +438,6 @@ float w_glauncher(float req)
        {
                W_GrenadeLauncher_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo);
-               return (autocvar_g_balance_grenadelauncher_reload_ammo && self.grenadelauncher_load) >= ammo_amount || self.ammo_rockets >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 4c5ce10b3e45f3d9bb92ea0374115d2d55e44cfa..2a8e4d7f47b0c35e0b9d8a8b2efc8d8ae08fb68a 100644 (file)
@@ -219,6 +219,17 @@ 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)
        {
@@ -251,15 +262,6 @@ float w_hagar(float req)
        {
                W_Hagar_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo);
-               return (autocvar_g_balance_hagar_reload_ammo && self.hagar_load >= ammo_amount) || self.ammo_rockets >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index b13976217aaabf138e18328febd1975925dff37c..bdbb88bc67337b0b86ac05bae959360e00761749 100644 (file)
@@ -257,6 +257,17 @@ float w_hlac(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hlac_secondary_animtime, w_ready);
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_HLAC_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -290,15 +301,6 @@ float w_hlac(float req)
        {
                W_HLAC_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo);
-               return (autocvar_g_balance_hlac_reload_ammo && self.hlac_load >= ammo_amount) || self.ammo_cells >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index ccf43ac1897ba28273515a33182650de3009ab98..9c8c63c11689e5e9f08081b12d1886cf6d326e1f 100644 (file)
@@ -252,11 +252,6 @@ float w_hook(float req)
        {
                self.hook_refire = time;
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // no reloading system, return true
-               return TRUE;
-       }
        return TRUE;
 };
 #endif
index ac79e9c5f6d918e86e24207ee1dbb8cd22f07f7b..33a9c164d42793fc16d15be54b8b933b44c553a5 100644 (file)
@@ -317,6 +317,17 @@ 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)
        {
@@ -338,11 +349,6 @@ float w_laser(float req)
                return TRUE;
        else if (req == WR_RELOAD)
                W_Laser_Reload();
-       else if (req == WR_SWITCHABLE)
-       {
-               // laser uses no ammo, always switchable
-               return TRUE;
-       }
        return TRUE;
 };
 #endif
index 1aa1b61d64c3bc8dfd9579b9265f10b8f7d183e2..6d307bb2f971d777f36b5dc540c34240c9027d45 100644 (file)
@@ -453,6 +453,18 @@ float w_minelayer(float req)
                        if(minfound)
                                sound (self, CHAN_WEAPON2, "weapons/mine_det.wav", VOL_BASE, ATTN_NORM);
                }
+
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_MineLayer_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -496,15 +508,6 @@ float w_minelayer(float req)
        {
                W_MineLayer_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = autocvar_g_balance_minelayer_ammo;
-               return (autocvar_g_balance_minelayer_reload_ammo && self.minelayer_load >= ammo_amount) || self.ammo_rockets >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index b5056b052deef07c1719aa37ac27327ff75fb897..8b01ceee849ff4cf48605b17ac8bb77809e73db0 100644 (file)
@@ -293,6 +293,17 @@ float w_minstanex(float req)
                                self.weapon = w;
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Minstanex_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -337,21 +348,6 @@ float w_minstanex(float req)
        {
                W_Minstanex_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               if(g_minstagib)
-                       ammo_amount = 1;
-               else
-                       ammo_amount = autocvar_g_balance_minstanex_ammo;
-               if(autocvar_g_balance_minstanex_laser_ammo)
-                       ammo_amount = min(ammo_amount, autocvar_g_balance_minstanex_laser_ammo);
-
-               return (autocvar_g_balance_minstanex_reload_ammo && self.minstanex_load >= ammo_amount) || self.ammo_cells >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 3bca97431dca94a93d5095eccfa9ef466546560e..e93262e92b471109a39423cf8843b2da21e6fe94 100644 (file)
@@ -264,6 +264,18 @@ float w_nex(float req)
                                self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
                        }
                }
+
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Nex_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -301,15 +313,6 @@ float w_nex(float req)
        {
                W_Nex_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo);
-               return (autocvar_g_balance_nex_reload_ammo && self.nex_load >= ammo_amount) || self.ammo_cells >= ammo_amount;
-       }
 
        return TRUE;
 };
index 551f30ce0e85c61acd44f9441693e247191e6a52..6d2981ae2ded54ab73784b41ac0b9b7c5c7aaf34 100644 (file)
@@ -284,11 +284,6 @@ float w_porto(float req)
        {
                self.porto_current = world;
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // no reloading system, return true
-               return TRUE;
-       }
        return TRUE;
 };
 #endif
index 7a89668c7080411c97f74d1160ffafc177af3987..ab30b0712d5851070bdebffbfc66e3a852723961 100644 (file)
@@ -495,6 +495,17 @@ float w_rlauncher(float req)
                                        sound (self, CHAN_WEAPON2, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_RocketLauncher_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -540,15 +551,6 @@ float w_rlauncher(float req)
        {
                W_RocketLauncher_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = autocvar_g_balance_rocketlauncher_ammo;
-               return (autocvar_g_balance_rocketlauncher_reload_ammo && self.rocketlauncher_load >= ammo_amount) || self.ammo_rockets >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index a4c4ded4927164004e14a2f3b9c909aee5f82ed1..b1cde626a0e74218028075eb035439e72cb8f5d2 100644 (file)
@@ -517,6 +517,18 @@ float w_seeker(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_flac_animtime, w_ready);
                        }
                }
+
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Seeker_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -551,15 +563,6 @@ float w_seeker(float req)
        {
                W_Seeker_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo);
-               return (autocvar_g_balance_seeker_reload_ammo && self.seeker_load >= ammo_amount) || self.ammo_rockets >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index c3ed59164f2c76b1801a53a920c2352cd4f49fb5..6242bf05bf671c3666bf2b668c1067da4957fc29 100644 (file)
@@ -164,6 +164,7 @@ void spawnfunc_weapon_shotgun(); // defined in t_items.qc
 
 float w_shotgun(float req)
 {
+       float ammo_amount;
        if (req == WR_AIM)
                if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range)
                        self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
@@ -194,6 +195,17 @@ float w_shotgun(float req)
                                weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_Shotgun_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -213,28 +225,18 @@ float w_shotgun(float req)
        }
        else if (req == WR_CHECKAMMO1)
        {
-               if(autocvar_g_balance_shotgun_reload_ammo)
-                       return self.shotgun_load >= autocvar_g_balance_shotgun_primary_ammo;
-               else
-                       return self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
+               ammo_amount = self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
+               ammo_amount += (autocvar_g_balance_shotgun_reload_ammo && self.shotgun_load >= autocvar_g_balance_shotgun_primary_ammo);
+               return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
-               return TRUE;
+               return FALSE;
        }
        else if (req == WR_RELOAD)
        {
                W_Shotgun_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = autocvar_g_balance_shotgun_primary_ammo;
-               return (autocvar_g_balance_shotgun_reload_ammo && self.shotgun_load >= ammo_amount) || self.ammo_shells >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 00e96bed13a3b0b45fd8a856e4da38365aa9bf2c..359ab4dfad553994d34709516abddaf6075b487d 100644 (file)
@@ -227,6 +227,17 @@ float w_sniperrifle(float req)
                                }
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_SniperRifle_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -265,15 +276,6 @@ float w_sniperrifle(float req)
                self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime;
                self.clip_load = autocvar_g_balance_sniperrifle_reload_ammo;
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo);
-               return (autocvar_g_balance_sniperrifle_reload_ammo && self.sniperrifle_load >= ammo_amount) || self.ammo_nails >= ammo_amount;
-       }
        return TRUE;
 };
 #endif
index 1a62d02c28b287ce52c01c0b880edbef01245d36..92d7413d658d9a4e5c25a8e2820a4fa7e3d0174a 100644 (file)
@@ -250,11 +250,6 @@ float w_tuba(float req)
                return TRUE; // TODO use fuel?
        else if (req == WR_CHECKAMMO2)
                return TRUE; // TODO use fuel?
-       else if (req == WR_SWITCHABLE)
-       {
-               // no reloading system, return true
-               return TRUE;
-       }
        return TRUE;
 };
 #endif
index 113b8f74f38725f6051ee950689d580f8c0f4f53..d841283433f359a696466e420529754d2883bfd8 100644 (file)
@@ -321,6 +321,17 @@ float w_uzi(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
                        }
                }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_UZI_Reload();
+                }
+            }
+        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -354,15 +365,6 @@ float w_uzi(float req)
        {
                W_UZI_Reload();
        }
-       else if (req == WR_SWITCHABLE)
-       {
-               // checks if this weapon can be switched to, when reloading is enabled
-               // returns true if there's either enough load in the weapon to use it,
-               // or we have enough ammo to reload the weapon to a usable point
-               float ammo_amount;
-               ammo_amount = min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo);
-               return (autocvar_g_balance_uzi_reload_ammo && self.uzi_load >= ammo_amount) || self.ammo_nails >= ammo_amount;
-       }
        return TRUE;
 };
 #endif