Merge branch 'reloadmap-fix' into 'master'

Make sure reloadingMap flag is reset when returning to menus

See merge request KartKrew/Kart!2014
This commit is contained in:
Oni 2024-03-06 22:06:27 +00:00
commit a76d2432a0
2 changed files with 7 additions and 1 deletions

View file

@ -1085,6 +1085,7 @@ void D_ClearState(void)
nextmapoverride = 0; nextmapoverride = 0;
skipstats = 0; skipstats = 0;
tutorialchallenge = TUTORIALSKIP_NONE; tutorialchallenge = TUTORIALSKIP_NONE;
gamemap = 1;
gameaction = ga_nothing; gameaction = ga_nothing;
memset(displayplayers, 0, sizeof(displayplayers)); memset(displayplayers, 0, sizeof(displayplayers));

View file

@ -8210,12 +8210,17 @@ void P_ResetLevelMusic(void)
if (tempmapmus_size > 1) if (tempmapmus_size > 1)
{ {
if (g_reloadingMap) if (g_reloadingMap == (modeattacking == ATTACKING_NONE))
{ {
// If restarting the map, simply cycle // If restarting the map, simply cycle
// through available alt music. // through available alt music.
idx = (mapmusrng + 1) % tempmapmus_size; idx = (mapmusrng + 1) % tempmapmus_size;
} }
else if (modeattacking)
{
// Short circuit the cycle.
idx = mapmusrng % tempmapmus_size;
}
else else
{ {
idx = random % tempmapmus_size; idx = random % tempmapmus_size;