]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/hlac.qc
Weapons: store switchweapon as direct weapon reference
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hlac.qc
index cebe69450a00386ea084593587299cc29851126c..260f4b00406dcd9ed5eb62450046c0cc5d88709a 100644 (file)
@@ -163,7 +163,7 @@ void W_HLAC_Attack2()
 // weapon frames
 void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 {
-       if(actor.weapon != actor.switchweapon) // abort immediately if switching
+       if(actor.weapon != PS(actor).m_switchweapon.m_id) // abort immediately if switching
        {
                w_ready(thiswep, actor, weaponentity, fire);
                return;
@@ -174,7 +174,7 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int
                if(!thiswep.wr_checkammo1(thiswep))
                if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
                {
-                       W_SwitchWeapon_Force(actor, Weapons_from(w_getbestweapon(actor)));
+                       W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
                        w_ready(thiswep, actor, weaponentity, fire);
                        return;
                }