Make intermission timer-dependent material consistent via K_CanChangeRules()

Prevents setting inttime 0 in singleplayer contexts
This commit is contained in:
toaster 2022-10-12 20:17:20 +01:00
parent 00b73d4a48
commit 9f4ced146a
3 changed files with 18 additions and 10 deletions

View file

@ -3922,7 +3922,7 @@ static void G_DoCompleted(void)
}
// play some generic music if there's no win/cool/lose music going on (for exitlevel commands)
if ((gametyperules & GTR_CIRCUIT) && ((multiplayer && demo.playback) || j == r_splitscreen+1) && (cv_inttime.value > 0))
if ((gametyperules & GTR_CIRCUIT) && ((multiplayer && demo.playback) || j == r_splitscreen+1) && (!K_CanChangeRules() || cv_inttime.value > 0))
S_ChangeMusicInternal("racent", true);
if (automapactive)

View file

@ -1286,7 +1286,7 @@ void P_DoPlayerExit(player_t *player)
}
}
if (cv_inttime.value > 0)
if (!K_CanChangeRules() || cv_inttime.value > 0)
P_EndingMusic(player);
if (P_CheckRacers())

View file

@ -806,23 +806,31 @@ void Y_StartIntermission(void)
powertype = K_UsingPowerLevels();
// determine the tic the intermission ends
if (!multiplayer || demo.playback)
if (!K_CanChangeRules())
{
timer = ((nump >= 2) ? 10 : 5)*TICRATE;
timer = 10*TICRATE;
}
else
{
timer = cv_inttime.value*TICRATE;
if (!timer)
timer = 1; // prevent a weird bug
}
// determine the tic everybody's scores/PWR starts getting sorted
sorttic = -1;
if (multiplayer || nump >= 2)
if (!timer)
{
sorttic = max((timer/2) - 2*TICRATE, 2*TICRATE); // 8 second pause after match results
// Prevent a weird bug
timer = 1;
}
else if (nump < 2 && !netgame)
{
// No PWR/global score, skip it
timer /= 2;
}
else
{
// Minimum two seconds for match results, then two second slideover approx halfway through
sorttic = max((timer/2) - 2*TICRATE, 2*TICRATE);
}
if (intermissiontypes[gametype] != int_none)
@ -841,7 +849,7 @@ void Y_StartIntermission(void)
case int_battle:
case int_battletime:
{
if (cv_inttime.value > 0)
if (timer > 1)
S_ChangeMusicInternal("racent", true); // loop it
// Calculate who won