From 0775134a58cda8bb6a49f1c49dfab018eec27f21 Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Thu, 4 Apr 2024 05:31:47 -0300 Subject: [PATCH] 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. --- src/p_pspr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_pspr.c b/src/p_pspr.c index 4576e7de..60d3472c 100644 --- a/src/p_pspr.c +++ b/src/p_pspr.c @@ -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); } //