]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
First phase, second part.
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 15:49:01 +0000 (17:49 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 11 Feb 2011 15:49:01 +0000 (17:49 +0200)
15 files changed:
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_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc
qcsrc/server/w_uzi.qc

index 8da5a271d2930c726e86d8ad4738823474296586..97b1b02188728f2c2416214b0a8b0ccc6db80d88 100644 (file)
@@ -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;
 };
index 4f4329d01277eea4b9814e75a7bb85376cd34599..c4be2d04ecf3bcf7ff30544917726964de6d1ef6 100644 (file)
@@ -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;
 };
index f6bbf36ce30af3f661ac500bdd6239b26c59077c..89da692f477e5ba5b1149f59f45d9d59f76187fd 100644 (file)
@@ -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;
 };
index c508a6095c36c05aeb402beab171350a5c1c415f..3571d50beb1a3d36b0130626ee286697cb01501d 100644 (file)
@@ -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;
 };
index e2ec34fffbdf91f1c888e4f059befbe08fa1c21b..078e36d26dd5b9941533d3a89ac5b2946b5cbaee 100644 (file)
@@ -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;
 };
index 2b50216e41756de2604900bb425aa31e9627af53..bbab9cdbc3a42bab25976506c0f77acbee0450b3 100644 (file)
@@ -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;
 };
index 70cf072fb5fab8e2eea91bc49d0332bf71c1ca25..749b0523d43888be6d21e4b6f687fb60ba4a9654 100644 (file)
@@ -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;
 };
index 6d145b037939db621b9b06a9e0723322f6d5354e..5fb00698a5744ca51309ab2691bf62ba126f65bb 100644 (file)
@@ -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;
 };
index 30212b4f17eaa7ffbd126982afa368e05cce6e4b..4a720a4914007ebdc1e9f1784f2c722ad0ec8f3e 100644 (file)
@@ -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;
 };
index ef6548cd9878a1f9a1a9cfc4bb9a8016708285c3..dbe8394c3c0a80cbe5024d10acfd6a4af2f4db74 100644 (file)
@@ -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;
index 6c148924990243f561364f4390054be7f5bdd852..adb62874ef97776f53f867e9ae21390b6173b387 100644 (file)
@@ -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;
 };
index 978bbcd9c7e69d33a39eda4ef3d342a11dbfb732..64f25a2c7aadb0b7d51d12d1fc5723a6568a1ced 100644 (file)
@@ -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;
 };
index 22abbd36bfc879f6691180a6b32f2367d3f15f5d..f522d19a17710ee1839d1ddcb23b44de0a295510 100644 (file)
@@ -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;
 };
index f099cc63704f2e609788e4a9fc52a100ce20ed6d..6c2621f9f4c14025151984e8e0475918c75e5553 100644 (file)
@@ -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;
 };
index 42929c1474f842cbd2236a9bed6c5de6dc96546e..bad5b9ed53397ef146b041c5aadba729e9deaca7 100644 (file)
@@ -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;
 };