diff --git a/src/d_event.h b/src/d_event.h index 18c9ee30..bb852966 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -93,7 +93,7 @@ typedef enum BT_CHANGE = 4, // The 4bit weapon mask and shift, convenience. -//BT_WEAPONMASK = (8+16+32), + BT_WEAPONMASK_OLD = (8+16+32), BT_WEAPONMASK = (8+16+32+64), // extended to pick up SSG // phares BT_WEAPONSHIFT = 3, diff --git a/src/hu_command.c b/src/hu_command.c index 0e995da2..ea2b1e9b 100644 --- a/src/hu_command.c +++ b/src/hu_command.c @@ -100,8 +100,10 @@ static void TicToHudCmd(hud_cmd_t *hud_cmd, const ticcmd_t *cmd) if (cmd->buttons & BT_CHANGE) { + const int bt_weaponmask = demo_compatibility ? + BT_WEAPONMASK_OLD : BT_WEAPONMASK; hud_cmd->change = - 1 + ((cmd->buttons & BT_WEAPONMASK) >> BT_WEAPONSHIFT); + 1 + ((cmd->buttons & bt_weaponmask) >> BT_WEAPONSHIFT); } else { diff --git a/src/p_user.c b/src/p_user.c index 71593e66..cd490417 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -482,6 +482,7 @@ void P_PlayerThink (player_t* player) if (demo_compatibility) { // compatibility mode -- required for old demos -- killough + newweapon = (cmd->buttons & BT_WEAPONMASK_OLD) >> BT_WEAPONSHIFT; if (newweapon == wp_fist && player->weaponowned[wp_chainsaw] && (player->readyweapon != wp_chainsaw || !player->powers[pw_strength]))