Merge branch 'fix-long-autoroulette' into 'master'

Fix autoroulette confirm timer being blockable

Closes #1320

See merge request KartKrew/Kart!2316
This commit is contained in:
Oni 2024-04-30 12:01:46 +00:00
commit d90a566ad7

View file

@ -1627,7 +1627,7 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
else if (roulette->autoroulette) else if (roulette->autoroulette)
{ {
// confirmItem = (roulette->speed > 15); // confirmItem = (roulette->speed > 15);
confirmItem = (roulette->elapsed == TICRATE*2); confirmItem = (roulette->elapsed >= TICRATE*2);
} }
else else
{ {
@ -1639,7 +1639,7 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
// If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item. // If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item.
// I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think. // I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think.
// Finally, if you get past this check, now you can actually start calculating what item you get. // Finally, if you get past this check, now you can actually start calculating what item you get.
if (confirmItem == true && (player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT|IF_USERINGS)) == 0) if (confirmItem == true && ((roulette->autoroulette) || (player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT|IF_USERINGS)) == 0))
{ {
if (roulette->eggman == true) if (roulette->eggman == true)
{ {