Merge branch 'garden-top-too-hard' into 'master'

Don't allow auto-roulette to get challenging items

See merge request KartKrew/Kart!2367
This commit is contained in:
Eidolon 2024-05-05 23:09:59 +00:00
commit 02c8ecbe0a

View file

@ -565,6 +565,18 @@ static boolean K_DenyShieldOdds(kartitems_t item)
return false;
}
static boolean K_DenyAutoRouletteOdds(kartitems_t item)
{
// Deny items that are too hard for newbies
switch (item)
{
case KITEM_GARDENTOP:
return true;
default:
return false;
}
}
/*--------------------------------------------------
static fixed_t K_AdjustSPBOdds(const itemroulette_t *roulette, UINT8 position)
@ -738,6 +750,14 @@ INT32 K_KartGetItemOdds(const player_t *player, itemroulette_t *const roulette,
return 0;
}
if (roulette->autoroulette == true)
{
if (K_DenyAutoRouletteOdds(item))
{
return 0;
}
}
if (gametype == GT_BATTLE)
{
I_Assert(pos < 2); // DO NOT allow positions past the bounds of the table