]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/vortex.qc
Merge branch 'master' into TimePath/items
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / vortex.qc
index 7d2db5517d0bea2bf2c937c1be55262f2a4a4c5b..584b1a5114f187b74ecf302540460572c6ad2cf4 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, bool fire1, bool fire2))
+               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);
@@ -161,15 +161,15 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
                                w.wr_reload(w);
                        } else
                        {
-                               if(fire1)
+                               if(fire & 1)
                                {
-                                       if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(vortex, refire)))
+                                       if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR_PRI(vortex, refire)))
                                        {
                                                W_Vortex_Attack(thiswep, 0);
-                                               weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(vortex, animtime), w_ready);
+                                               weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR_PRI(vortex, animtime), w_ready);
                                        }
                                }
-                               if((WEP_CVAR(vortex, charge) && !WEP_CVAR(vortex, secondary)) ? (actor.BUTTON_ZOOM | actor.BUTTON_ZOOMSCRIPT) : fire2)
+                               if((WEP_CVAR(vortex, charge) && !WEP_CVAR(vortex, secondary)) ? (actor.BUTTON_ZOOM | actor.BUTTON_ZOOMSCRIPT) : (fire & 2))
                                {
                                        if(WEP_CVAR(vortex, charge))
                                        {
@@ -196,7 +196,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
 
                                                        else if(WEP_CVAR_SEC(vortex, ammo))
                                                        {
-                                                               if(fire2) // only eat ammo when the button is pressed
+                                                               if(fire & 2) // only eat ammo when the button is pressed
                                                                {
                                                                        dt = min(dt, (1 - actor.vortex_charge) / WEP_CVAR(vortex, charge_rate));
                                                                        if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -235,10 +235,10 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
                                        }
                                        else if(WEP_CVAR(vortex, secondary))
                                        {
-                                               if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_SEC(vortex, refire)))
+                                               if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR_SEC(vortex, refire)))
                                                {
                                                        W_Vortex_Attack(thiswep, 1);
-                                                       weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_SEC(vortex, animtime), w_ready);
+                                                       weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR_SEC(vortex, animtime), w_ready);
                                                }
                                        }
                                }