]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/shockwave.qc
Merge branch 'master' into TimePath/items
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / shockwave.qc
index 5fddb3b12d74bdefb8d4b228490bef05432d9ce4..3c40adc316a865bdee0e331c38700c028410680b 100644 (file)
@@ -229,10 +229,10 @@ void W_Shockwave_Melee_Think(void)
        }
 }
 
-void W_Shockwave_Melee(Weapon thiswep, entity actor, bool fire1, bool fire2)
+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);
+       weapon_thinkf(actor, slot, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
 
        entity meleetemp;
        meleetemp = spawn();
@@ -675,28 +675,28 @@ 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, bool fire1, bool fire2))
+               METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, int slot, int fire))
                {
-                       if(fire1)
+                       if(fire & 1)
                        {
                                if(time >= actor.shockwave_blasttime) // handle refire separately so the secondary can be fired straight after a primary
                                {
-                                       if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(shockwave, blast_animtime)))
+                                       if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR(shockwave, blast_animtime)))
                                        {
                                                W_Shockwave_Attack();
                                                actor.shockwave_blasttime = time + WEP_CVAR(shockwave, blast_refire) * W_WeaponRateFactor();
-                                               weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready);
+                                               weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready);
                                        }
                                }
                        }
-                       else if(fire2)
+                       else if(fire & 2)
                        {
                                //if(actor.clip_load >= 0) // we are not currently reloading
                                if(!actor.crouch) // no crouchmelee please
-                               if(weapon_prepareattack(thiswep, actor, true, WEP_CVAR(shockwave, melee_refire)))
+                               if(weapon_prepareattack(thiswep, actor, slot, true, WEP_CVAR(shockwave, melee_refire)))
                                {
                                        // attempt forcing playback of the anim by switching to another anim (that we never play) here...
-                                       weapon_thinkf(actor, WFRAME_FIRE1, 0, W_Shockwave_Melee);
+                                       weapon_thinkf(actor, slot, WFRAME_FIRE1, 0, W_Shockwave_Melee);
                                }
                        }
                }