]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Weapons: pass weapon index
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 28 Oct 2015 04:24:35 +0000 (15:24 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 28 Oct 2015 04:24:35 +0000 (15:24 +1100)
46 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/turrets/turret.qh
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/weapons/weapon.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hmg.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/rpc.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/defs.qh
qcsrc/server/mutators/mutator/mutator_overkill.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/server/weapons/weaponsystem.qh

index 490951459875e501f27db9215d9303ed51e6084c..5f07c100c9d4e44f547cd4316ec1cf8448c8d884 100644 (file)
@@ -854,7 +854,7 @@ float ball_customize()
        return true;
 }
 
-       METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, int fire))
+       METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, int slot, int fire))
        {
                if(fire & 1)
                        if(weapon_prepareattack(thiswep, actor, false, autocvar_g_balance_nexball_primary_refire))
index 611e3b884799ebb65175057c8bbf22e34abd0ec9..f38bd791293a3844c353ea7a9fbba2f3d6e6e9fe 100644 (file)
@@ -41,7 +41,7 @@ REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
 
 void M_Mage_Attack_Spike(vector dir);
 void M_Mage_Attack_Push();
-METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, int fire)) {
+METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, int slot, int fire)) {
     if (fire & 1)
     if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, false, 0.2)) {
         if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
@@ -363,7 +363,7 @@ float M_Mage_Attack(float attack_type, entity targ)
                        if(random() <= 0.7)
                        {
                                Weapon wep = WEP_MAGE_SPIKE;
-                               wep.wr_think(wep, self, 2);
+                               wep.wr_think(wep, self, 0, 2);
                                return true;
                        }
 
@@ -385,7 +385,7 @@ float M_Mage_Attack(float attack_type, entity targ)
                                        self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
                                        self.anim_finished = time + 1;
                                        Weapon wep = WEP_MAGE_SPIKE;
-                                       wep.wr_think(wep, self, 1);
+                                       wep.wr_think(wep, self, 0, 1);
                                        return true;
                                }
                        }
index 52bda4ec95e53e3dddb6c878182148fd96fd49c8..1aa1c602047e65ee9a33735301d1af0a7fa886dc 100644 (file)
@@ -50,7 +50,7 @@ float autocvar_g_monster_spider_attack_bite_delay;
 
 void M_Spider_Attack_Web();
 
-METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, int fire)) {
+METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if ((!isPlayer && time >= actor.spider_web_delay) || weapon_prepareattack(thiswep, actor, false, autocvar_g_monster_spider_attack_web_delay)) {
@@ -160,12 +160,12 @@ bool M_Spider_Attack(int attack_type, entity targ)
                Weapon wep = WEP_SPIDER_ATTACK;
                case MONSTER_ATTACK_MELEE:
                {
-                       wep.wr_think(wep, self, 2);
+                       wep.wr_think(wep, self, 0, 2);
                        return true;
                }
                case MONSTER_ATTACK_RANGED:
                {
-                       wep.wr_think(wep, self, 1);
+                       wep.wr_think(wep, self, 0, 1);
                        return true;
                }
        }
index b3bb5bfe8eb030ed1dbf1d61333f0ad0c00614e0..e2d9f964c7f2e333885cbc6d02d475f27c99bc4f 100644 (file)
@@ -48,7 +48,7 @@ float autocvar_g_monster_wyvern_attack_fireball_speed;
 void M_Wyvern_Attack_Fireball_Explode();
 void M_Wyvern_Attack_Fireball_Touch();
 
-METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, int fire)) {
+METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, int slot, int fire)) {
     if (fire & 1)
     if (time > actor.attack_finished_single || weapon_prepareattack(thiswep, actor, false, 1.2)) {
         if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
@@ -128,7 +128,7 @@ float M_Wyvern_Attack(float attack_type, entity targ)
                {
                        w_shotdir = normalize((self.enemy.origin + '0 0 10') - self.origin);
                        Weapon wep = WEP_WYVERN_ATTACK;
-                       wep.wr_think(wep, self, 1);
+                       wep.wr_think(wep, self, 0, 1);
                        return true;
                }
        }
index 32f92a6750b90ccdf44097d9b47a661f1ec18009..ab8ee0111589064d37cf8159615e0d3703832ec9 100644 (file)
@@ -46,7 +46,7 @@ CLASS(Turret, Object)
     /** (SERVER) called when turret attacks */
     METHOD(Turret, tr_attack, void(Turret this)) {
         Weapon w = this.m_weapon;
-        w.wr_think(w, self, 1);
+        w.wr_think(w, self, 0, 1);
     }
     /** (ALL) */
     METHOD(Turret, tr_config, void(Turret this)) {
index 904260300c6b651678be33e3ce1a97b3d7b3dae0..eb90e253e2f90d4e5244900f4229e394a525b745 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack));
 #ifdef SVQC
 
 void turret_initparams(entity);
-METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
index afba577f1f218e5bdc95caefe8214b9c5d25d3f3..5c602e70e4a159a0acbf01a044dcf213e96fa278 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_WEAPON(FLAC, NEW(FlacAttack));
 #ifdef SVQC
 
 void turret_flac_projectile_think_explode();
-METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
index 94e6d5f411041c4cd3a5d5c2c3f922e3fb0da5a2..3f85f85ae22b555dc022a53439bf7261a623a11d 100644 (file)
@@ -19,7 +19,7 @@ float autocvar_g_turrets_unit_hellion_shot_speed_gain;
 float autocvar_g_turrets_unit_hellion_shot_speed_max;
 
 void turret_hellion_missile_think();
-METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
index c7c781872c3296c85448930823d6b9eecb64e30d..17d80713092f85a0d985496a717c87d0b0fc8e77 100644 (file)
@@ -23,7 +23,7 @@ float autocvar_g_turrets_unit_hk_shot_speed_max;
 float autocvar_g_turrets_unit_hk_shot_speed_turnrate;
 
 void turret_hk_missile_think();
-METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
 {
        bool isPlayer = IS_PLAYER(actor);
        if (fire & 1)
index 9dfff9e439cb8a511d3adaa0b0ceb395bb4fb016..ac0eae164a00d7934dcb83a697dfcb1aaab31865 100644 (file)
@@ -17,7 +17,7 @@ REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack));
 
 void W_MachineGun_MuzzleFlash();
 
-METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
index 45a12543814fac5dad9ea877f192c9c8ae56cd55..fa4b1fa6a9109feb4f648848572bd6a08158ae2d 100644 (file)
@@ -15,7 +15,7 @@ REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack));
 
 #ifdef SVQC
 
-METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
index d493486f70be556995e9e0c7ace0bcf745e1424f..8e746049b6a4e8c8d5506bc265bb93375d28b64d 100644 (file)
@@ -18,7 +18,7 @@ void beam_think();
 
 .int fireflag;
 
-METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
index 3a032f2a7b5938363bfc2a38eca9bf72a395f502..6b47f40155ffc608b8cd65b36c15d630b287d109 100644 (file)
@@ -15,7 +15,7 @@ REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack));
 
 #ifdef SVQC
 
-METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
        bool isPlayer = IS_PLAYER(actor);
        if (fire & 1)
        if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
index de3a6d3a87477be8ad3f3524da1cb3eb86b94e2c..61d3b0efcdd41f61df3a3ce0711652795781bf81 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack));
 #ifdef SVQC
 
 entity toast(entity from, float range, float damage);
-METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
index b4c8a5d9f905d43ef58072a8009b95617328e13c..266599791b4dffb62beaa0e74f0d497301460018 100644 (file)
@@ -15,7 +15,7 @@ REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack));
 
 #ifdef SVQC
 
-METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
index 1c3d33129882d21ce08f9a05fe4c321b83962804..6844efa082b8767321ff45dca41fd1071995a8c3 100644 (file)
@@ -321,7 +321,7 @@ float racer_frame()
                // Fix z-aim (for chase mode)
                crosshair_trace(player);
                w_shotdir.z = normalize(trace_endpos - org).z * 0.5;
-               wep1.wr_think(wep1, self, 1);
+               wep1.wr_think(wep1, self, 0, 1);
        }
 
        if(autocvar_g_vehicle_racer_rocket_locktarget)
index d58705b59984755bd036f7cba9829a5f62865cee..528078f8de12a5f6f6b184bd7168a353b260f243 100644 (file)
@@ -42,7 +42,7 @@ float autocvar_g_vehicle_racer_rocket_climbspeed;
 float autocvar_g_vehicle_racer_rocket_locked_maxangle;
 
 void racer_fire_rocket(vector org, vector dir, entity trg);
-METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
     entity player = isPlayer ? actor : actor.owner;
index 422dd8a6413ecf1469b1cb03b246898fe43966ab..7d90dd485b42f1f89fdd0172faf9adfac83c51ff 100644 (file)
@@ -392,7 +392,7 @@ float raptor_frame()
        if(player.BUTTON_ATCK)
        if (wep1.wr_checkammo1(wep1))
        {
-               wep1.wr_think(wep1, self, 1);
+               wep1.wr_think(wep1, self, 0, 1);
        }
 
        if(self.vehicle_flags  & VHF_SHIELDREGEN)
@@ -411,7 +411,7 @@ float raptor_frame()
                if(time > raptor.lip + autocvar_g_vehicle_raptor_bombs_refire)
                if(player.BUTTON_ATCK2)
                {
-                       wep2a.wr_think(wep2a, self, 2);
+                       wep2a.wr_think(wep2a, self, 1, 2);
                        raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
                        raptor.lip   = time;
                }
@@ -422,7 +422,7 @@ float raptor_frame()
                if(time > raptor.lip + autocvar_g_vehicle_raptor_flare_refire)
                if(player.BUTTON_ATCK2)
                {
-                       wep2b.wr_think(wep2b, self, 2);
+                       wep2b.wr_think(wep2b, self, 1, 2);
                        raptor.delay = time + autocvar_g_vehicle_raptor_flare_refire;
                        raptor.lip   = time;
                }
index 32752c9ce8d7fb6004127b3f429f72a8ef5ebe55..d1d2dd1cb7722a38847e7527dff481868ea90302 100644 (file)
@@ -51,7 +51,7 @@ float autocvar_g_vehicle_raptor_bomblet_radius;
 float autocvar_g_vehicle_raptor_bomblet_force;
 float autocvar_g_vehicle_raptor_bomblet_explode_delay;
 
-METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     entity player = isPlayer ? actor : actor.owner;
     entity veh = player.vehicle;
@@ -88,7 +88,7 @@ METHOD(RaptorCannon, wr_checkammo1, bool(RacerAttack thiswep)) {
 float autocvar_g_vehicle_raptor_bombs_refire;
 
 void raptor_bombdrop();
-METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     entity player = isPlayer ? actor : actor.owner;
     entity veh = player.vehicle;
@@ -109,7 +109,7 @@ void raptor_flare_think();
 void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 void raptor_flare_touch();
 
-METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
     entity player = isPlayer ? actor : actor.owner;
     entity veh = player.vehicle;
index 61629595da3c0f4f4f8addae3c6702d5670cf750..3643b18f82212c27212699c81b8df3381b253a31 100644 (file)
@@ -47,7 +47,7 @@ CLASS(Weapon, Object)
     /** (SERVER) setup weapon data */
     METHOD(Weapon, wr_setup, void(Weapon this)) {}
     /** (SERVER) logic to run every frame */
-    METHOD(Weapon, wr_think, void(Weapon this, entity actor, int fire)) {}
+    METHOD(Weapon, wr_think, void(Weapon this, entity actor, int slot, int fire)) {}
     /** (SERVER) checks ammo for weapon primary */
     METHOD(Weapon, wr_checkammo1, bool(Weapon this)) {return false;}
     /** (SERVER) checks ammo for weapon second */
index 08be8f7d218bb8947807266ffd815c624d63f127..53359ee98c1c13cb90e9e33025d6c274fd69f791 100644 (file)
@@ -656,7 +656,7 @@ void Arc_Smoke()
                                );
                        }
                }
-               METHOD(Arc, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Arc, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        Arc_Player_SetHeat(actor);
                        Arc_Smoke();
index 69b97bf6643aeea9f5b195771d4a0bb763dd0a81..36b08287fa9d3867c25953d16996dadd5a2a0a41 100644 (file)
@@ -161,7 +161,7 @@ void W_Blaster_Attack(
                                { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
                }
 
-               METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, int fire))
+               METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, int slot, int fire))
                {
                        if(fire & 1)
                        {
index 8875dac4e6e5005610993e6111f612cae8392958..4b5454c122ba7ef6a0218631c78aeae059c55be9 100644 (file)
@@ -574,7 +574,7 @@ void W_Crylink_Attack2(Weapon thiswep)
                        else
                                self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
                }
-               METHOD(Crylink, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Crylink, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_crylink_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
index fc6b8af19ec45912c74708eccd76df73d1a28aef..9dd08bb3e3bd91bec8c645e85523c0be8fc51dba 100644 (file)
@@ -520,7 +520,7 @@ void W_Devastator_Attack(Weapon thiswep)
                        }
                }
                #endif
-               METHOD(Devastator, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Devastator, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(devastator, reload_ammo) && actor.clip_load < WEP_CVAR(devastator, ammo)) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
index a85f43ea351e1b25adc1aec7409307470377b463..e353f05f188fb7d7f712bfcc09f30101023029af 100644 (file)
@@ -406,7 +406,7 @@ void W_Electro_Attack_Orb(Weapon thiswep)
        MUTATOR_CALLHOOK(EditProjectile, self, proj);
 }
 
-void W_Electro_CheckAttack(Weapon thiswep, entity actor, int fire)
+void W_Electro_CheckAttack(Weapon thiswep, entity actor, int slot, int fire)
 {SELFPARAM();
        if(self.electro_count > 1)
        if(self.BUTTON_ATCK2)
@@ -418,7 +418,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, int fire)
                return;
        }
        // WEAPONTODO: when the player releases the button, cut down the length of refire2?
-       w_ready(thiswep, actor, fire);
+       w_ready(thiswep, actor, slot, fire);
 }
 
 .float bot_secondary_electromooth;
@@ -451,7 +451,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, int fire)
                                }
                        }
                }
-               METHOD(Electro, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Electro, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO
                        {
index f56d06857f2b1795991beb156afb2d122dc69fcd..7a7ff9dee39a27e853bdd4a79dd1d81ac1df5b7d 100644 (file)
@@ -226,31 +226,31 @@ void W_Fireball_AttackEffect(float i, vector f_diff)
        Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 }
 
-void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, int slot, int fire)
 {
        W_Fireball_Attack1();
        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), w_ready);
 }
 
-void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor, int slot, int fire)
 {
        W_Fireball_AttackEffect(0, '+1.25 +3.75 0');
        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame4);
 }
 
-void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor, int slot, int fire)
 {
        W_Fireball_AttackEffect(0, '-1.25 +3.75 0');
        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame3);
 }
 
-void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor, int slot, int fire)
 {
        W_Fireball_AttackEffect(1, '+1.25 -3.75 0');
        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame2);
 }
 
-void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, int slot, int fire)
 {SELFPARAM();
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
        sound(self, CH_WEAPON_SINGLE, SND_FIREBALL_PREFIRE2, VOL_BASE, ATTEN_NORM);
@@ -371,14 +371,14 @@ void W_Fireball_Attack2(void)
                                }
                        }
                }
-               METHOD(Fireball, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Fireball, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(fire & 1)
                        {
                                if(time >= actor.fireball_primarytime)
                                if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(fireball, refire)))
                                {
-                                       W_Fireball_Attack1_Frame0(thiswep, actor, fire);
+                                       W_Fireball_Attack1_Frame0(thiswep, actor, slot, fire);
                                        actor.fireball_primarytime = time + WEP_CVAR_PRI(fireball, refire2) * W_WeaponRateFactor();
                                }
                        }
index c88c91e7c9a922ea4d8a80cdec0a5298bf588886..e1dcffe83694e90a3b9ea268322203cf6a4890ed 100644 (file)
@@ -407,7 +407,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep)
                        else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
                                self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
                }
-               METHOD(Hagar, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Hagar, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        float loadable_secondary;
                        loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary));
index d738c81d314b12a06262cc9291eed869c0906269..ec95a988bff8421e88eb7266ce348b9f9d1bf46b 100644 (file)
@@ -161,11 +161,11 @@ void W_HLAC_Attack2(void)
 }
 
 // weapon frames
-void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, int fire)
+void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, int slot, int fire)
 {
        if(actor.weapon != actor.switchweapon) // abort immediately if switching
        {
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -176,7 +176,7 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, int fire)
                if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-                       w_ready(thiswep, actor, fire);
+                       w_ready(thiswep, actor, slot, fire);
                        return;
                }
 
@@ -211,7 +211,7 @@ void W_HLAC_Attack2_Frame(Weapon thiswep)
                {
                        self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
                }
-               METHOD(HLAC, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(HLAC, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_hlac_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
index fc9811713fcaaf5e3347792a02e271b41a719c28..3a00de3136ed2d3e2b1e251390b7d28cc7d27034 100644 (file)
@@ -45,11 +45,11 @@ HMG_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 
 spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(WEP_HMG.m_id); }
 
-void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
+void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int slot, int fire)
 {
        if (!actor.BUTTON_ATCK)
        {
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -58,7 +58,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
        if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -96,7 +96,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
                        else
                                self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
                }
-               METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(hmg, reload_ammo) && actor.clip_load < WEP_CVAR(hmg, ammo)) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
@@ -107,7 +107,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
                                if (weapon_prepareattack(thiswep, actor, false, 0))
                                {
                                        actor.misc_bulletcounter = 0;
-                                       W_HeavyMachineGun_Attack_Auto(thiswep, actor, fire);
+                                       W_HeavyMachineGun_Attack_Auto(thiswep, actor, slot, fire);
                                }
                        }
                }
index 56c2800798109d9bd7fdecfd67aeb628c27ae70d..93aa633b4ce5b5710538a39b411a00881489e3d8 100644 (file)
@@ -22,7 +22,7 @@ CLASS(OffhandHook, OffhandWeapon)
     METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
     {
        Weapon wep = WEP_HOOK;
-       wep.wr_think(wep, actor, key_pressed ? 1 : 0);
+       wep.wr_think(wep, actor, 1, key_pressed ? 1 : 0);
     }
 ENDCLASS(OffhandHook)
 OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
@@ -174,7 +174,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor)
        MUTATOR_CALLHOOK(EditProjectile, actor, gren);
 }
 
-               METHOD(Hook, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Hook, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if (fire & 1) {
                                if(!actor.hook)
index 8241d1ecafc6227469f756fe4614a38079d76a52..62287acb29e122c1e95cb575056b568ad0d96851 100644 (file)
@@ -137,11 +137,11 @@ void W_MachineGun_Attack(Weapon thiswep, int deathtype)
 }
 
 // weapon frames
-void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, int fire)
+void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, int slot, int fire)
 {
        if(actor.weapon != actor.switchweapon) // abort immediately if switching
        {
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
        if(actor.BUTTON_ATCK)
@@ -151,7 +151,7 @@ void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, int fire)
                if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
                {
                        W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-                       w_ready(thiswep, actor, fire);
+                       w_ready(thiswep, actor, slot, fire);
                        return;
                }
                actor.misc_bulletcounter = actor.misc_bulletcounter + 1;
@@ -163,13 +163,13 @@ void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, int fire)
 }
 
 
-void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
+void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, int slot, int fire)
 {
        float machinegun_spread;
 
        if(!(fire & 1))
        {
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -178,7 +178,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
        if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -208,7 +208,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), W_MachineGun_Attack_Auto);
 }
 
-void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int fire)
+void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int slot, int fire)
 {
        W_SetupShot(actor, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
        if(!autocvar_g_norecoil)
@@ -247,7 +247,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int fire)
                        else
                                self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
                }
-               METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(machinegun, reload_ammo) && actor.clip_load < min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
@@ -259,7 +259,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int fire)
                                if(weapon_prepareattack(thiswep, actor, false, 0))
                                {
                                        actor.misc_bulletcounter = 0;
-                                       W_MachineGun_Attack_Auto(thiswep, actor, fire);
+                                       W_MachineGun_Attack_Auto(thiswep, actor, slot, fire);
                                }
 
                                if(fire & 2)
@@ -270,14 +270,14 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int fire)
                                        if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
                                        {
                                                W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-                                               w_ready(thiswep, actor, fire);
+                                               w_ready(thiswep, actor, slot, fire);
                                                return;
                                        }
 
                                        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(machinegun, burst_ammo));
 
                                        actor.misc_bulletcounter = WEP_CVAR(machinegun, burst) * -1;
-                                       W_MachineGun_Attack_Burst(thiswep, actor, fire);
+                                       W_MachineGun_Attack_Burst(thiswep, actor, slot, fire);
                                }
                        }
                        else
index b2f9d161db8f2597b5ae5fb56ab929c13345342a..abed99b8d059aee66eb887899c7b2839cbad8032 100644 (file)
@@ -499,7 +499,7 @@ float W_MineLayer_PlacedMines(float detonate)
                                if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
                        }
                }
-               METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_minelayer_reload_ammo && actor.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
                        {
index d788e7b8855c58e1237e3b4f701461150ce1aede..043f8f63b458273d0b5efcc8c944354e39cff763 100644 (file)
@@ -334,7 +334,7 @@ void W_Mortar_Attack2(Weapon thiswep)
                        wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime))));
                        wepinfo_ter_dps = 0;
                        */
-               METHOD(Mortar, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Mortar, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_mortar_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
index b02edd055045f87d7dfa2b35c4ad526aba32c2f0..8761040b31bfcaa54ff7491745fa1e8d984ea32c 100644 (file)
@@ -306,7 +306,7 @@ void W_Porto_Attack(float type)
                {
                        PORTO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
                }
-               METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(porto, secondary))
                        {
index 9ac992669b2d8f94184726e0c19d5a77b0ffe7f2..6b5ed19975f22fd5246182f1c5b97ff32e32533f 100644 (file)
@@ -90,7 +90,7 @@ void W_Rifle_Attack2(void)
 .float rifle_bullethail_frame;
 .float rifle_bullethail_animtime;
 .float rifle_bullethail_refire;
-void W_Rifle_BulletHail_Continue(Weapon thiswep, entity actor, int fire)
+void W_Rifle_BulletHail_Continue(Weapon thiswep, entity actor, int slot, int fire)
 {
        float r, sw, af;
 
@@ -160,7 +160,7 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt
                                }
                        }
                }
-               METHOD(Rifle, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Rifle, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_rifle_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
index 5d9052363844305fedfddfa3d92b002c0ff338d4..b87b3371b5ea27a23ee2431b4a0de8faea232140 100644 (file)
@@ -153,7 +153,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep)
                {
                        self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
                }
-               METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(rpc, reload_ammo) && actor.clip_load < WEP_CVAR(rpc, ammo)) {
                                Weapon w = get_weaponinfo(actor.weapon);
index 78a65129f938bdbf23ed777442aedece57b4415b..303c563fefbbfc5435cc267a04fd4efa954441b8 100644 (file)
@@ -608,7 +608,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep)
                        else
                                self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
                }
-               METHOD(Seeker, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Seeker, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(autocvar_g_balance_seeker_reload_ammo && actor.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) { // forced reload
                                Weapon w = get_weaponinfo(actor.weapon);
index 47f6e36b146c312e1ab9ba5b10035765d37e5d9c..bd220ff7cf0ae7020da0102c521e86e4db35e356 100644 (file)
@@ -229,7 +229,7 @@ void W_Shockwave_Melee_Think(void)
        }
 }
 
-void W_Shockwave_Melee(Weapon thiswep, entity actor, int fire)
+void W_Shockwave_Melee(Weapon thiswep, entity actor, int slot, int fire)
 {
        sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTN_NORM);
        weapon_thinkf(actor, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
@@ -675,7 +675,7 @@ void W_Shockwave_Attack(void)
                        else
                                { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
                }
-               METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(fire & 1)
                        {
index cd1e2ea781820e21907a15704b59263f4941b043..42b99969a6505de82d3d78155e6ce40a9d4d85fe 100644 (file)
@@ -181,7 +181,7 @@ void W_Shotgun_Melee_Think(void)
        }
 }
 
-void W_Shotgun_Attack2(Weapon thiswep, entity actor, int fire)
+void W_Shotgun_Attack2(Weapon thiswep, entity actor, int slot, int fire)
 {
        sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTEN_NORM);
        weapon_thinkf(actor, WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
@@ -195,14 +195,14 @@ void W_Shotgun_Attack2(Weapon thiswep, entity actor, int fire)
 }
 
 // alternate secondary weapon frames
-void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, int fire)
+void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, int slot, int fire)
 {
        Weapon w = get_weaponinfo(actor.weapon);
        if (!w.wr_checkammo2(w))
        if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -210,14 +210,14 @@ void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, int fire)
        W_Shotgun_Attack(WEP_SHOTGUN, true); // actually is secondary, but we trick the last shot into playing full reload sound
        weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
 }
-void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, int fire)
+void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, int slot, int fire)
 {
        Weapon w = get_weaponinfo(actor.weapon);
        if (!w.wr_checkammo2(w))
        if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
-               w_ready(thiswep, actor, fire);
+               w_ready(thiswep, actor, slot, fire);
                return;
        }
 
@@ -234,7 +234,7 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, int fire)
                        else
                                self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
                }
-               METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(shotgun, reload_ammo) && actor.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload
                        {
index 46c4095112046f0dedd1edd140d6214bcae8245c..688152e0a4275e9a53841e597818817e2b929437 100644 (file)
@@ -379,7 +379,7 @@ void W_Tuba_NoteOn(float hittype)
                                        self.BUTTON_ATCK2 = 1;
                        }
                }
-               METHOD(Tuba, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Tuba, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(fire & 1)
                        if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(tuba, refire)))
index bbdeb69ac22c1577b2684d447cafb4adedfb73e2..c7de3881b53f3c789bffd5030ec0cfe514bf900c 100644 (file)
@@ -244,7 +244,7 @@ void W_RocketMinsta_Attack3 (void)
                        else
                                self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
                }
-               METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
                        // if the laser uses load, we also consider its ammo for reloading
index f8e33f6369a7d90d75159c33af84e5f6baa09034..a3843dae17080168cea2382a7eed23e03a729db4 100644 (file)
@@ -143,7 +143,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
                                        self.BUTTON_ATCK2 = true;
                        }
                }
-               METHOD(Vortex, wr_think, void(entity thiswep, entity actor, int fire))
+               METHOD(Vortex, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
                        if(WEP_CVAR(vortex, charge) && actor.vortex_charge < WEP_CVAR(vortex, charge_limit))
                                actor.vortex_charge = min(1, actor.vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME);
index a15309274215c8993dfce707de6f6b0c7ba1542b..99814e015415da9d3eb8dd53682e51f1b0c5f221 100644 (file)
@@ -163,11 +163,11 @@ const float MAX_DAMAGEEXTRARADIUS = 16;
 // WEAPONTODO
 .float autoswitch;
 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
-void w_clear(Weapon thiswep, entity actor, int fire);
-void w_ready(Weapon thiswep, entity actor, int fire);
+void w_clear(Weapon thiswep, entity actor, int slot, int fire);
+void w_ready(Weapon thiswep, entity actor, int slot, int fire);
 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
 .float weapon_nextthink;
-.void(Weapon thiswep, entity actor, int fire) weapon_think;
+.void(Weapon thiswep, entity actor, int slot, int fire) weapon_think;
 
 
 // weapon states (self.weaponentity.state)
index c86626395be136ef88dd582458ffff83d0dad7e6..a07c18e134d5566e1bd5af4bf15e08919b39860f 100644 (file)
@@ -208,7 +208,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
                }
                Weapon wpn = get_weaponinfo(self.weapon);
                if(self.weaponentity.state != WS_CLEAR)
-                       w_ready(wpn, self, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
+                       w_ready(wpn, self, 0, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
 
                self.weapon_blocked = true;
        }
index a29f1b5ec43039c14024c0508c0137e5d1949d4c..f47916e1dd5e95d91c28f7bd14392391a1e89de7 100644 (file)
@@ -92,7 +92,7 @@ float W_WeaponSpeedFactor()
 }
 
 
-void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int fire) func);
+void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int slot, int fire) func);
 
 bool CL_Weaponentity_CustomizeEntityForClient()
 {
@@ -466,7 +466,7 @@ void CL_SpawnWeaponentity(entity e)
 }
 
 // Weapon subs
-void w_clear(Weapon thiswep, entity actor, int fire)
+void w_clear(Weapon thiswep, entity actor, int slot, int fire)
 {
        if (actor.weapon != -1)
        {
@@ -480,7 +480,7 @@ void w_clear(Weapon thiswep, entity actor, int fire)
        }
 }
 
-void w_ready(Weapon thiswep, entity actor, int fire)
+void w_ready(Weapon thiswep, entity actor, int slot, int fire)
 {
        if (actor.weaponentity) actor.weaponentity.state = WS_READY;
        weapon_thinkf(actor, WFRAME_IDLE, 1000000, w_ready);
@@ -592,7 +592,7 @@ bool weapon_prepareattack(Weapon thiswep, entity actor, bool secondary, float at
        return false;
 }
 
-void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int fire) func)
+void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int slot, int fire) func)
 {
        bool restartanim;
        if (fr == WFRAME_DONTCHANGE)
@@ -687,7 +687,7 @@ void W_WeaponFrame(entity actor)
                if (actor.weaponentity.state != WS_CLEAR)
                {
                        Weapon wpn = get_weaponinfo(actor.weapon);
-                       w_ready(wpn, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+                       w_ready(wpn, actor, 0, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
                        return;
                }
        }
@@ -803,7 +803,7 @@ void W_WeaponFrame(entity actor)
                                actor.hook_switchweapon = key_pressed;
                                Weapon h = WEP_HOOK;
                                block_weapon = (actor.weapon == h.m_id && (actor.BUTTON_ATCK || key_pressed));
-                               h.wr_think(h, actor, block_weapon ? 1 : 0);
+                               h.wr_think(h, actor, 0, block_weapon ? 1 : 0);
                        }
                }
 
@@ -812,7 +812,7 @@ void W_WeaponFrame(entity actor)
                        if (w)
                        {
                                Weapon e = get_weaponinfo(actor.weapon);
-                               e.wr_think(e, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+                               e.wr_think(e, actor, 0, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
                        }
                        else
                        {
@@ -829,7 +829,7 @@ void W_WeaponFrame(entity actor)
                                v_right = ri;
                                v_up = up;
                                Weapon wpn = get_weaponinfo(actor.weapon);
-                               actor.weapon_think(wpn, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+                               actor.weapon_think(wpn, actor, 0, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
                        }
                        else
                        {
@@ -909,7 +909,7 @@ void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use)
 .float reload_complain;
 .string reload_sound;
 
-void W_ReloadedAndReady(Weapon thiswep, entity actor, int fire)
+void W_ReloadedAndReady(Weapon thiswep, entity actor, int slot, int fire)
 {
        // finish the reloading process, and do the ammo transfer
 
@@ -936,7 +936,7 @@ void W_ReloadedAndReady(Weapon thiswep, entity actor, int fire)
        // ATTACK_FINISHED(actor) -= actor.reload_time - 1;
 
        Weapon wpn = get_weaponinfo(actor.weapon);
-       w_ready(wpn, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+       w_ready(wpn, actor, slot, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
 }
 
 void W_Reload(entity actor, float sent_ammo_min, string sent_sound)
index ee84a7c611471cc7019f4d5eb94c4ae385495ecd..28f93440625ca912cc10e5f6be604a8fbd44b027 100644 (file)
@@ -44,6 +44,6 @@ bool weapon_prepareattack_check(Weapon thiswep, entity actor, float secondary, f
 
 void weapon_prepareattack_do(entity actor, float secondary, float attacktime);
 
-void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int fire) func);
+void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int slot, int fire) func);
 
 #endif