Fix some weapon-switching issues (#1634)

More specifically, this fixes a bug whereby weapon alignment wouldn't take effect if the weapon were fired right after raising it, and seemingly another bug regarding improper handling of the case where the raising state is the same as the ready state.
This commit is contained in:
Alaux 2024-04-04 05:31:47 -03:00 committed by GitHub
parent ddf5a034d1
commit 0775134a58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -80,8 +80,6 @@ void A_Recoil(player_t* player)
static void P_SetPsprite(player_t *player, int position, statenum_t stnum)
{
P_SetPspritePtr(player, &player->psprites[position], stnum);
if (position == ps_weapon)
{
const weaponinfo_t wp = weaponinfo[player->readyweapon];
@ -91,6 +89,8 @@ static void P_SetPsprite(player_t *player, int position, statenum_t stnum)
else if (stnum == wp.downstate)
player->switching = weapswitch_lowering;
}
P_SetPspritePtr(player, &player->psprites[position], stnum);
}
//