From: Mircea Kitsune Date: Fri, 11 Feb 2011 15:49:01 +0000 (+0200) Subject: First phase, second part. X-Git-Tag: xonotic-v0.5.0~309^2~7^2~56 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=03914e08e75d005bef83e6999f07dbe08acd3718;p=xonotic%2Fxonotic-data.pk3dir.git First phase, second part. --- diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index 8da5a271d..97b1b0218 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -9,11 +9,6 @@ REGISTER_WEAPON(CRYLINK, w_crylink, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_FLAG_RELO .entity queuenext; .entity queueprev; -void W_Crylink_Reload() -{ - W_Reload(ammo_cells, min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav"); -} - void W_Crylink_CheckLinks(entity e) { float i; @@ -553,7 +548,7 @@ float w_crylink(float req) else if (req == WR_THINK) { if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo)) // forced reload - W_Crylink_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (!self.crylink_waitrelease) @@ -649,7 +644,7 @@ float w_crylink(float req) } else if (req == WR_RELOAD) { - W_Crylink_Reload(); + W_Reload(ammo_cells, min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index 4f4329d01..c4be2d04e 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -5,11 +5,6 @@ REGISTER_WEAPON(ELECTRO, w_electro, IT_CELLS, 5, WEP_FLAG_NORMAL | WEP_FLAG_RELO .float electro_count; .float electro_secondarytime; -void W_Electro_Reload() -{ - W_Reload(ammo_cells, min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav"); -} - void W_Plasma_Explode_Combo (void); void W_Plasma_TriggerCombo(vector org, float rad, entity own) @@ -441,7 +436,7 @@ float w_electro(float req) if(!ammo_amount) { - W_Electro_Reload(); + weapon_action(self.weapon, WR_RELOAD); return FALSE; } } @@ -549,7 +544,7 @@ float w_electro(float req) } else if (req == WR_RELOAD) { - W_Electro_Reload(); + W_Reload(ammo_cells, min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index f6bbf36ce..89da692f4 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -6,15 +6,6 @@ REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_FLAG_RELOADABLE | WEP_TYPE .vector fireball_impactvec; .float fireball_primarytime; -void W_Fireball_Reload() -{ - // fuel can be a non-whole number, which brakes stuff here when between 0 and 1 - if(self.ammo_fuel < 1) - self.ammo_fuel = 0; - - W_Reload(ammo_fuel, min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav"); -} - void W_Fireball_Explode (void) { entity e; @@ -356,7 +347,7 @@ float w_fireball(float req) else if (req == WR_THINK) { if(autocvar_g_balance_fireball_reload_ammo && self.clip_load < min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo)) // forced reload - W_Fireball_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (time >= self.fireball_primarytime) @@ -408,7 +399,11 @@ float w_fireball(float req) } else if (req == WR_RELOAD) { - W_Fireball_Reload(); + // fuel can be a non-whole number, which brakes stuff here when between 0 and 1 + if(self.ammo_fuel < 1) + self.ammo_fuel = 0; + + W_Reload(ammo_fuel, min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index c508a6095..3571d50be 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -5,11 +5,6 @@ REGISTER_WEAPON(GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, WEP_FLAG_NORMAL | .float gl_detonate_later; .float gl_bouncecnt; -void W_GrenadeLauncher_Reload() -{ - W_Reload(ammo_rockets, min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav"); -} - void W_Grenade_Explode (void) { if(other.takedamage == DAMAGE_AIM) @@ -311,7 +306,7 @@ float w_glauncher(float req) else if (req == WR_THINK) { if(autocvar_g_balance_grenadelauncher_reload_ammo && self.clip_load < min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo)) // forced reload - W_GrenadeLauncher_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_grenadelauncher_primary_refire)) @@ -376,7 +371,7 @@ float w_glauncher(float req) } else if (req == WR_RELOAD) { - W_GrenadeLauncher_Reload(); + W_Reload(ammo_rockets, min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index e2ec34fff..078e36d26 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -4,11 +4,6 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_RELOAD #ifdef SVQC // NO bounce protection, as bounces are limited! -void W_Hagar_Reload() -{ - W_Reload(ammo_rockets, min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav"); -} - void W_Hagar_Explode (void) { self.event_damage = SUB_Null; @@ -156,7 +151,7 @@ float w_hagar(float req) else if (req == WR_THINK) { if(autocvar_g_balance_hagar_reload_ammo && self.clip_load < min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo)) // forced reload - W_Hagar_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire)) @@ -200,7 +195,7 @@ float w_hagar(float req) } else if (req == WR_RELOAD) { - W_Hagar_Reload(); + W_Reload(ammo_rockets, min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_hlac.qc b/qcsrc/server/w_hlac.qc index 2b50216e4..bbab9cdbc 100644 --- a/qcsrc/server/w_hlac.qc +++ b/qcsrc/server/w_hlac.qc @@ -3,11 +3,6 @@ REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE #else #ifdef SVQC -void W_HLAC_Reload() -{ - W_Reload(ammo_cells, min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav"); -} - void W_HLAC_Touch (void) { PROJECTILE_TOUCH; @@ -192,7 +187,7 @@ float w_hlac(float req) else if (req == WR_THINK) { if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo)) // forced reload - W_HLAC_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire)) @@ -239,7 +234,7 @@ float w_hlac(float req) } else if (req == WR_RELOAD) { - W_HLAC_Reload(); + W_Reload(ammo_cells, min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_laser.qc b/qcsrc/server/w_laser.qc index 70cf072fb..749b0523d 100644 --- a/qcsrc/server/w_laser.qc +++ b/qcsrc/server/w_laser.qc @@ -4,11 +4,6 @@ REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WE #ifdef SVQC void(float imp) W_SwitchWeapon; -void W_Laser_Reload() -{ - W_Reload(zero_ammo, 0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav"); -} - void W_Laser_Touch (void) { PROJECTILE_TOUCH; @@ -232,7 +227,7 @@ float w_laser(float req) else if (req == WR_THINK) { if(autocvar_g_balance_laser_reload_ammo && self.clip_load < 1) // forced reload - W_Laser_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire)) @@ -301,7 +296,7 @@ float w_laser(float req) } else if (req == WR_RELOAD) { - W_Laser_Reload(); + W_Reload(zero_ammo, 0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_minelayer.qc b/qcsrc/server/w_minelayer.qc index 6d145b037..5fb00698a 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -6,11 +6,6 @@ void W_Mine_Think (void); .float minelayer_detonate, minelayer_mines; .float mine_time; -void W_MineLayer_Reload() -{ - W_Reload(ammo_rockets, autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav"); -} - void spawnfunc_weapon_minelayer (void) { weapon_defaultspawnfunc(WEP_MINE_LAYER); @@ -390,7 +385,7 @@ float w_minelayer(float req) else if (req == WR_THINK) { if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < autocvar_g_balance_minelayer_ammo) // forced reload - W_MineLayer_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if(weapon_prepareattack(0, autocvar_g_balance_minelayer_refire)) @@ -453,7 +448,7 @@ float w_minelayer(float req) } else if (req == WR_RELOAD) { - W_MineLayer_Reload(); + W_Reload(ammo_rockets, autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 30212b4f1..4a720a491 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -4,14 +4,6 @@ REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_ #ifdef SVQC .float minstanex_lasthit; -void W_Minstanex_Reload() -{ - if(autocvar_g_balance_minstanex_laser_ammo) - W_Reload(ammo_cells, min(autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo), autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav"); - else - W_Reload(ammo_cells, autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav"); -} - void W_MinstaNex_Attack (void) { float flying; @@ -211,9 +203,9 @@ float w_minstanex(float req) // if the laser uses load, we also consider its ammo for reloading if(autocvar_g_balance_minstanex_reload_ammo && autocvar_g_balance_minstanex_laser_ammo && self.clip_load < min(minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo)) // forced reload - W_Minstanex_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if(autocvar_g_balance_minstanex_reload_ammo && self.clip_load < minstanex_ammo) // forced reload - W_Minstanex_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { if (weapon_prepareattack(0, autocvar_g_balance_minstanex_refire)) @@ -284,7 +276,10 @@ float w_minstanex(float req) } else if (req == WR_RELOAD) { - W_Minstanex_Reload(); + if(autocvar_g_balance_minstanex_laser_ammo) + W_Reload(ammo_cells, min(autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo), autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav"); + else + W_Reload(ammo_cells, autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index ef6548cd9..dbe8394c3 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -3,11 +3,6 @@ REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | #else #ifdef SVQC -void W_Nex_Reload() -{ - W_Reload(ammo_cells, min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav"); -} - void SendCSQCNexBeamParticle(float charge) { vector v; v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos); @@ -119,7 +114,7 @@ float w_nex(float req) } if(autocvar_g_balance_nex_reload_ammo && self.clip_load < min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo)) // forced reload - W_Nex_Reload(); + weapon_action(self.weapon, WR_RELOAD); else { if (self.BUTTON_ATCK) @@ -251,7 +246,7 @@ float w_nex(float req) } else if (req == WR_RELOAD) { - W_Nex_Reload(); + W_Reload(ammo_cells, min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav"); } return TRUE; diff --git a/qcsrc/server/w_rocketlauncher.qc b/qcsrc/server/w_rocketlauncher.qc index 6c1489249..adb62874e 100644 --- a/qcsrc/server/w_rocketlauncher.qc +++ b/qcsrc/server/w_rocketlauncher.qc @@ -5,11 +5,6 @@ REGISTER_WEAPON(ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, WEP_FLAG_NORMAL | W .float rl_release; .float rl_detonate_later; -void W_RocketLauncher_Reload() -{ - W_Reload(ammo_rockets, autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav"); -} - void W_Rocket_Unregister() { if(self.owner && self.owner.lastrocket == self) @@ -419,7 +414,7 @@ float w_rlauncher(float req) else if (req == WR_THINK) { if(autocvar_g_balance_rocketlauncher_reload_ammo && self.clip_load < autocvar_g_balance_rocketlauncher_ammo) // forced reload - W_RocketLauncher_Reload(); + weapon_action(self.weapon, WR_RELOAD); else { if (self.BUTTON_ATCK) @@ -490,7 +485,7 @@ float w_rlauncher(float req) } else if (req == WR_RELOAD) { - W_RocketLauncher_Reload(); + W_Reload(ammo_rockets, autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index 978bbcd9c..64f25a2c7 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -5,11 +5,6 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_RELO //.float proxytime; = autoswitch //.float tl; = wait -void W_Seeker_Reload() -{ - W_Reload(ammo_rockets, min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav"); -} - void Seeker_Missile_Explode () { self.event_damage = SUB_Null; @@ -453,7 +448,7 @@ float w_seeker(float req) else if (req == WR_THINK) { if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload - W_Seeker_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if (self.BUTTON_ATCK) { @@ -501,7 +496,7 @@ float w_seeker(float req) } else if (req == WR_RELOAD) { - W_Seeker_Reload(); + W_Reload(ammo_rockets, min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index 22abbd36b..f522d19a1 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -3,11 +3,6 @@ REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_FLAG_REL #else #ifdef SVQC -void W_Shotgun_Reload() -{ - W_Reload(ammo_shells, autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav"); -} - void W_Shotgun_Attack (void) { float sc; @@ -129,7 +124,7 @@ float w_shotgun(float req) { // don't force reload an empty shotgun if its melee attack is active if not(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo) - W_Shotgun_Reload(); + weapon_action(self.weapon, WR_RELOAD); } else { @@ -181,7 +176,7 @@ float w_shotgun(float req) } else if (req == WR_RELOAD) { - W_Shotgun_Reload(); + W_Reload(ammo_shells, autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index f099cc637..6c2621f9f 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -8,11 +8,6 @@ REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_F .float sniperrifle_accumulator; -void W_SniperRifle_Reload() -{ - W_Reload(ammo_nails, min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo), autocvar_g_balance_sniperrifle_reload_ammo, autocvar_g_balance_sniperrifle_reload_time, "weapons/reload.wav"); -} - void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant) { // if this weapon is reloadable, decrease its load. Else decrease the player's ammo @@ -151,7 +146,7 @@ float w_sniperrifle(float req) else if (req == WR_THINK) { if(autocvar_g_balance_sniperrifle_reload_ammo && self.clip_load < min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)) // forced reload - W_SniperRifle_Reload(); + weapon_action(self.weapon, WR_RELOAD); else { self.sniperrifle_accumulator = bound(time - autocvar_g_balance_sniperrifle_bursttime, self.sniperrifle_accumulator, time); @@ -168,7 +163,7 @@ float w_sniperrifle(float req) if (autocvar_g_balance_sniperrifle_secondary) { if(autocvar_g_balance_sniperrifle_secondary_reload) - W_SniperRifle_Reload(); + weapon_action(self.weapon, WR_RELOAD); else { if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire)) @@ -214,7 +209,7 @@ float w_sniperrifle(float req) } else if (req == WR_RELOAD) { - W_SniperRifle_Reload(); + W_Reload(ammo_nails, min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo), autocvar_g_balance_sniperrifle_reload_ammo, autocvar_g_balance_sniperrifle_reload_time, "weapons/reload.wav"); } return TRUE; }; diff --git a/qcsrc/server/w_uzi.qc b/qcsrc/server/w_uzi.qc index 42929c147..bad5b9ed5 100644 --- a/qcsrc/server/w_uzi.qc +++ b/qcsrc/server/w_uzi.qc @@ -3,11 +3,6 @@ REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | #else #ifdef SVQC -void W_UZI_Reload() -{ - W_Reload(ammo_nails, min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav"); -} - // leilei's fancy muzzleflash stuff void UZI_Flash_Go() { @@ -220,7 +215,7 @@ float w_uzi(float req) else if (req == WR_THINK) { if(autocvar_g_balance_uzi_reload_ammo && self.clip_load < min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo)) // forced reload - W_UZI_Reload(); + weapon_action(self.weapon, WR_RELOAD); else if(autocvar_g_balance_uzi_mode == 1) { if (self.BUTTON_ATCK) @@ -323,7 +318,7 @@ float w_uzi(float req) } else if (req == WR_RELOAD) { - W_UZI_Reload(); + W_Reload(ammo_nails, min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav"); } return TRUE; };