Fix weird inconsistent initialization of cangrabitems maybe???

I took a shower and I want to go to bed
This commit is contained in:
Antonio Martinez 2025-05-27 03:38:04 -04:00
parent da2a1dfd77
commit 0ae5ca3341
2 changed files with 17 additions and 9 deletions

View file

@ -2352,8 +2352,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
bot = players[player].bot;
botdifficulty = players[player].botvars.difficulty;
cangrabitems = players[player].cangrabitems;
botdiffincrease = players[player].botvars.diffincrease;
botrival = players[player].botvars.rival;
@ -2439,13 +2437,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
tallyactive = false;
cangrabitems = 0;
if (gametyperules & GTR_SPHERES
|| gametyperules & GTR_CATCHER
|| G_TimeAttackStart()
|| gametype == GT_TUTORIAL
|| !M_NotFreePlay()
|| K_GetNumWaypoints() == 0)
cangrabitems = EARLY_ITEM_FLICKER;
}
else
{
@ -2501,6 +2492,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
{
tally = players[player].tally;
}
cangrabitems = players[player].cangrabitems;
}
spectatorReentry = (betweenmaps ? 0 : players[player].spectatorReentry);

View file

@ -9781,6 +9781,21 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->invincibilitytimer--;
}
// The precise ordering of start-of-level made me want to cut my head off,
// so let's try this instead. Whatever!
if (leveltime < introtime)
{
if ((gametyperules & GTR_SPHERES)
|| (gametyperules & GTR_CATCHER)
|| G_TimeAttackStart()
|| (gametype == GT_TUTORIAL)
|| !M_NotFreePlay()
|| (K_GetNumWaypoints() == 0))
player->cangrabitems = EARLY_ITEM_FLICKER;
else
player->cangrabitems = 0;
}
if (player->cangrabitems && player->cangrabitems <= EARLY_ITEM_FLICKER)
player->cangrabitems++;