From: Mircea Kitsune Date: Sun, 23 Jan 2011 14:16:18 +0000 (+0200) Subject: Remove the switchable check and do all checks in the WR_CHECKAMMO checks. Only fixed... X-Git-Tag: xonotic-v0.5.0~309^2~7^2~92 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3d8d2443c67863a2c3daf8340803145321347fde;p=xonotic%2Fxonotic-data.pk3dir.git Remove the switchable check and do all checks in the WR_CHECKAMMO checks. Only fixed for the shotgun, fixing for the other weapons next --- diff --git a/qcsrc/server/cl_weapons.qc b/qcsrc/server/cl_weapons.qc index db53b0181..864dd77fc 100644 --- a/qcsrc/server/cl_weapons.qc +++ b/qcsrc/server/cl_weapons.qc @@ -1,6 +1,6 @@ void W_Reload() { - weapon_action(self.switchweapon, WR_RELOAD); + self.wish_reload = 1; } // switch between weapons diff --git a/qcsrc/server/cl_weaponsystem.qc b/qcsrc/server/cl_weaponsystem.qc index 5f8d8b053..91450dd2b 100644 --- a/qcsrc/server/cl_weaponsystem.qc +++ b/qcsrc/server/cl_weaponsystem.qc @@ -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) { diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 10f6763fb..06d0a3bf5 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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; diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index 4f3d5ae23..73f9f5864 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -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 diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index 247437bc0..cd03bdceb 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -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 diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index 43764ab5e..ea34c80af 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -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 diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index 3817c9ef9..77bf031b3 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -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 diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 4c5ce10b3..2a8e4d7f4 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -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 diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index b13976217..bdbb88bc6 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -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 diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index ccf43ac18..9c8c63c11 100644 --- a/qcsrc/server/w_hook.qc +++ b/qcsrc/server/w_hook.qc @@ -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 diff --git a/qcsrc/server/w_laser.qc b/qcsrc/server/w_laser.qc index ac79e9c5f..33a9c164d 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -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 diff --git a/qcsrc/server/w_minelayer.qc b/qcsrc/server/w_minelayer.qc index 1aa1b61d6..6d307bb2f 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -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 diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index b5056b052..8b01ceee8 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -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 diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 3bca97431..e93262e92 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -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; }; diff --git a/qcsrc/server/w_porto.qc b/qcsrc/server/w_porto.qc index 551f30ce0..6d2981ae2 100644 --- a/qcsrc/server/w_porto.qc +++ b/qcsrc/server/w_porto.qc @@ -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 diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index 7a89668c7..ab30b0712 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -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 diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index a4c4ded49..b1cde626a 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -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 diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index c3ed59164..6242bf05b 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -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 diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index 00e96bed1..359ab4dfa 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -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 diff --git a/qcsrc/server/w_tuba.qc b/qcsrc/server/w_tuba.qc index 1a62d02c2..92d7413d6 100644 --- a/qcsrc/server/w_tuba.qc +++ b/qcsrc/server/w_tuba.qc @@ -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 diff --git a/qcsrc/server/w_uzi.qc b/qcsrc/server/w_uzi.qc index 113b8f74f..d84128343 100644 --- a/qcsrc/server/w_uzi.qc +++ b/qcsrc/server/w_uzi.qc @@ -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