Commit 320f5341 authored by Richard Gobeille's avatar Richard Gobeille

Duke3d: add SK_WEAPON_MASK macro, comprised of the four SK_WEAPON_BITS values

parent 95078053
......@@ -77,6 +77,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define SK_WEAPON_BITS1 9
#define SK_WEAPON_BITS2 10
#define SK_WEAPON_BITS3 11
#define SK_WEAPON_MASK ((1 << SK_WEAPON_BITS) | (1 << SK_WEAPON_BITS1) | (1 << SK_WEAPON_BITS2) | (1 << SK_WEAPON_BITS3))
#define SK_STEROIDS 12
#define SK_LOOK_UP 13
#define SK_LOOK_DOWN 14
......
......@@ -3192,7 +3192,7 @@ void P_GetInput(int const playerNum)
else if (weaponSelection == gamefunc_Weapon_1-1)
weaponSelection = 0;
if ((localInput.bits & 0xf00) == 0)
if (weaponSelection && (localInput.bits & SK_WEAPON_MASK) == 0)
localInput.bits |= (weaponSelection << SK_WEAPON_BITS);
localInput.bits |= (BUTTON(gamefunc_Fire) << SK_FIRE);
......
......@@ -2788,7 +2788,7 @@ CHECKINV1:
}
}
weaponNum = ((playerBits&(15<<SK_WEAPON_BITS))>>SK_WEAPON_BITS) - 1;
weaponNum = ((playerBits&SK_WEAPON_MASK)>>SK_WEAPON_BITS) - 1;
switch ((int32_t)weaponNum)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment