Change Next/Previous Weapon button handling for Duke and RR games.

- Resolves inability to change weapons under SDL-based environments as reported at https://forum.zdoom.org/viewtopic.php?f=340&t=67232#p1142970
This commit is contained in:
Mitchell Richters 2020-03-23 21:22:44 +11:00 committed by Christoph Oelckers
parent e777225093
commit 02d436f802
2 changed files with 16 additions and 4 deletions

View file

@ -3202,10 +3202,16 @@ void P_GetInput(int const playerNum)
weaponSelection = 14;
else if (buttonMap.ButtonDown(gamefunc_Alt_Weapon))
weaponSelection = 13;
else if (buttonMap.ButtonDown(gamefunc_Next_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
else if (buttonMap.ButtonPressed(gamefunc_Next_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
{
weaponSelection = 12;
else if (buttonMap.ButtonDown(gamefunc_Previous_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
buttonMap.ClearButton(gamefunc_Next_Weapon);
}
else if (buttonMap.ButtonPressed(gamefunc_Previous_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
{
weaponSelection = 11;
buttonMap.ClearButton(gamefunc_Previous_Weapon);
}
else if (weaponSelection == gamefunc_Weapon_1-1)
weaponSelection = 0;

View file

@ -3383,10 +3383,16 @@ void P_GetInput(int const playerNum)
weaponSelection = 14;
else if (buttonMap.ButtonDown(gamefunc_Alt_Weapon))
weaponSelection = 13;
else if (buttonMap.ButtonDown(gamefunc_Next_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
else if (buttonMap.ButtonPressed(gamefunc_Next_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel > 0))
{
weaponSelection = 12;
else if (buttonMap.ButtonDown(gamefunc_Previous_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
buttonMap.ClearButton(gamefunc_Next_Weapon);
}
else if (buttonMap.ButtonPressed(gamefunc_Previous_Weapon) || (buttonMap.ButtonDown(gamefunc_Dpad_Select) && input.fvel < 0))
{
weaponSelection = 11;
buttonMap.ClearButton(gamefunc_Previous_Weapon);
}
else if (weaponSelection == gamefunc_Weapon_1-1)
weaponSelection = 0;