Protect against invalid readyweapon (#1807)

Co-authored-by: kraflab <kraflab@gmail.com>
This commit is contained in:
Fabian Greffrath 2024-07-31 14:42:41 +02:00 committed by GitHub
parent 29d3fabef0
commit 6eb4413fb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -586,7 +586,10 @@ void A_Lower(player_t *player, pspdef_t *psp)
return; return;
} }
player->readyweapon = player->pendingweapon; if (player->pendingweapon < NUMWEAPONS || !mbf21)
{
player->readyweapon = player->pendingweapon;
}
P_BringUpWeapon(player); P_BringUpWeapon(player);
} }