Merge branch 'gp-bonus-fix' into 'master'

Last GP bonus round fixes

Closes #740, #1104, and #1049

See merge request KartKrew/Kart!2034
This commit is contained in:
AJ Martinez 2024-03-07 23:15:49 +00:00
commit bd8f1fb6bb
5 changed files with 15 additions and 12 deletions

View file

@ -2879,7 +2879,7 @@ mapthing_t *G_FindMapStart(INT32 playernum)
// -- DM/Tag/CTF-spectator/etc --
// Order: DM->CTF->Race
else if (gametyperules & GTR_BATTLESTARTS)
else if ((gametyperules & GTR_BATTLESTARTS) && !battleprisons)
spawnpoint = G_FindBattleStartOrFallback(playernum);
// -- Other game modes --

View file

@ -125,11 +125,6 @@ void K_TimerReset(void)
g_pointlimit = 0;
}
boolean K_ShouldSpawnDuelItems(void)
{
return (inDuel == true || (grandprixinfo.gp && grandprixinfo.eventmode == GPEVENT_BONUS));
}
static void K_SpawnItemCapsules(void)
{
mapthing_t *mt = mapthings;
@ -281,7 +276,10 @@ void K_TimerInit(void)
timelimitintics = K_TimeLimitForGametype();
g_pointlimit = K_PointLimitForGametype();
if (K_ShouldSpawnDuelItems())
// K_TimerInit is called after all mapthings are spawned,
// so they didn't know if it's supposed to be a duel
// (inDuel is always false before K_TimerInit is called).
if (inDuel)
{
K_SpawnDuelOnlyItems();
}

View file

@ -233,8 +233,6 @@ void K_KartEbrakeVisuals(player_t *p);
void K_HandleDirectionalInfluence(player_t *player);
fixed_t K_DefaultPlayerRadius(player_t *player);
boolean K_ShouldSpawnDuelItems(void);
// sound stuff for lua
void K_PlayAttackTaunt(mobj_t *source);
void K_PlayBoostTaunt(mobj_t *source);

View file

@ -12486,12 +12486,18 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
break;
}
if (!K_ShouldSpawnDuelItems())
// This duel check is tricky.
// At map load, inDuel is always false, because
// K_TimerInit is called afterward. K_TimerInit will then
// spawn all the duel mode objects itself, which ends up
// calling this function again.
// So that's why this check is even here.
if (inDuel == false && (grandprixinfo.gp == false || grandprixinfo.eventmode != GPEVENT_BONUS))
{
if (K_IsDuelItem(i) == true
&& K_DuelItemAlwaysSpawns(mthing) == false)
{
// Only spawns in Duels.
// Only spawns in Duels or GP bonus rounds.
return false;
}
}

View file

@ -1081,7 +1081,8 @@ void P_Ticker(boolean run)
ACS_RunPositionScript();
}
if (timelimitintics > 0 && leveltime == (timelimitintics + starttime + 1))
if ((gametyperules & GTR_OVERTIME) && !battleprisons &&
timelimitintics > 0 && leveltime == (timelimitintics + starttime + 1))
{
ACS_RunOvertimeScript();
}