diff --git a/src/doomstat.h b/src/doomstat.h index 321f42306..06a38d724 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -42,6 +42,7 @@ extern "C" { // Selected by user. extern INT16 gamemap; +extern boolean g_reloadingMap; extern char mapmusname[7]; extern UINT32 mapmusposition; extern UINT32 mapmusresume; diff --git a/src/f_finale.c b/src/f_finale.c index e751084bc..ce3e42ac2 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1496,6 +1496,7 @@ void F_StartTitleScreen(void) gamestate_t prevwipegamestate = wipegamestate; titlemapinaction = true; gamemap = titleMapNum+1; + g_reloadingMap = false; G_DoLoadLevelEx(true, GS_TITLESCREEN); if (!titlemap) @@ -1536,6 +1537,7 @@ void F_StartTitleScreen(void) G_SetGamestate(GS_TITLESCREEN); titlemapinaction = false; gamemap = 1; // g_game.c + g_reloadingMap = false; CON_ClearHUD(); } diff --git a/src/g_game.c b/src/g_game.c index 3b42d85df..19d513924 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -109,7 +109,8 @@ UINT32 mapmusposition; // Position to jump to UINT32 mapmusresume; UINT8 mapmusrng; // Random selection result -INT16 gamemap = 1; +INT16 gamemap = 0; +boolean g_reloadingMap; UINT32 maptol; preciptype_t globalweather = PRECIP_NONE; @@ -5925,6 +5926,7 @@ void G_InitNew(UINT8 pencoremode, INT32 map, boolean resetplayer, boolean skippr } } + g_reloadingMap = (map == gamemap); gamemap = map; automapactive = false; diff --git a/src/k_podium.cpp b/src/k_podium.cpp index dbf4f16cb..072a4e075 100644 --- a/src/k_podium.cpp +++ b/src/k_podium.cpp @@ -940,6 +940,7 @@ boolean K_StartCeremony(void) && mapheaderinfo[podiumMapNum]->lumpnum != LUMPERROR) { gamemap = podiumMapNum+1; + g_reloadingMap = false; encoremode = grandprixinfo.encore; diff --git a/src/p_saveg.c b/src/p_saveg.c index afbdb0594..2f8a5d66b 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -6422,6 +6422,7 @@ static boolean P_NetUnArchiveMisc(savebuffer_t *save, boolean reloading) gametic = READUINT32(save->p); gamemap = READINT16(save->p); + g_reloadingMap = false; // gamemap changed; we assume that its map header is always valid, // so make it so