Skip to content

Commit

Permalink
Protect against invalid readyweapon
Browse files Browse the repository at this point in the history
Co-Authored-By: Fabian Greffrath <[email protected]>
  • Loading branch information
kraflab and fabiangreffrath committed Jul 26, 2024
1 parent 962cf97 commit fb53471
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prboom2/src/p_pspr.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,10 @@ void A_Lower(player_t *player, pspdef_t *psp)
return;
}

player->readyweapon = player->pendingweapon;
if (player->pendingweapon < NUMWEAPONS || !mbf21)
{
player->readyweapon = player->pendingweapon;
}

P_BringUpWeapon(player);
}
Expand Down

1 comment on commit fb53471

@kraflab
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: not regression tested yet, wait for v0.28 tag.

Please sign in to comment.