Merge branch 'common-garden-shield' into 'master'

Don't lose Garden Top when stumbling; normalize item odds

See merge request KartKrew/Kart!1076
This commit is contained in:
Gunla 2023-03-23 01:12:40 +00:00
commit 42f860a838
2 changed files with 25 additions and 33 deletions

View file

@ -6109,15 +6109,19 @@ void K_PopPlayerShield(player_t *player)
return;
}
// Doesn't apply to non-S3K shields.
if (shield == KSHIELD_NONE || shield == KSHIELD_TOP)
switch (shield)
{
return;
}
case KSHIELD_NONE:
// Doesn't apply to non-S3K shields.
return;
if (shield == KSHIELD_LIGHTNING)
{
K_DoLightningShield(player);
case KSHIELD_TOP:
Obj_GardenTopDestroy(player);
return; // everything is handled by Obj_GardenTopDestroy
case KSHIELD_LIGHTNING:
K_DoLightningShield(player);
break;
}
player->curshield = KSHIELD_NONE;
@ -6180,12 +6184,10 @@ void K_DropHnextList(player_t *player)
orbit = false;
type = MT_EGGMANITEM;
break;
case MT_GARDENTOP:
Obj_GardenTopDestroy(player);
return;
// intentionally do nothing
case MT_ROCKETSNEAKER:
case MT_SINK_SHIELD:
case MT_GARDENTOP:
return;
default:
continue;

View file

@ -441,40 +441,30 @@ static UINT32 K_GetItemRouletteDistance(const player_t *player, UINT8 numPlayers
--------------------------------------------------*/
static boolean K_DenyShieldOdds(kartitems_t item)
{
INT32 shieldType = K_GetShieldFromItem(item);
const INT32 shieldType = K_GetShieldFromItem(item);
size_t i;
if ((gametyperules & GTR_CIRCUIT) == 0)
{
return false;
}
switch (shieldType)
if (shieldType == KSHIELD_NONE)
{
case KSHIELD_NONE:
/* Marble Garden Top is not REALLY
a Sonic 3 shield */
case KSHIELD_TOP:
return false;
}
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] == false || players[i].spectator == true)
{
break;
continue;
}
default:
if (shieldType == K_GetShieldFromItem(players[i].itemtype))
{
size_t i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] == false || players[i].spectator == true)
{
continue;
}
if (shieldType == K_GetShieldFromItem(players[i].itemtype))
{
// Don't allow more than one of each shield type at a time
return true;
}
}
// Don't allow more than one of each shield type at a time
return true;
}
}