Add g_reloadingMap, true if the map is restarted/retried

This commit is contained in:
James R 2023-11-27 06:24:32 -08:00
parent d3f9c6e826
commit 5d0c062785
5 changed files with 8 additions and 1 deletions

View file

@ -42,6 +42,7 @@ extern "C" {
// Selected by user. // Selected by user.
extern INT16 gamemap; extern INT16 gamemap;
extern boolean g_reloadingMap;
extern char mapmusname[7]; extern char mapmusname[7];
extern UINT32 mapmusposition; extern UINT32 mapmusposition;
extern UINT32 mapmusresume; extern UINT32 mapmusresume;

View file

@ -1496,6 +1496,7 @@ void F_StartTitleScreen(void)
gamestate_t prevwipegamestate = wipegamestate; gamestate_t prevwipegamestate = wipegamestate;
titlemapinaction = true; titlemapinaction = true;
gamemap = titleMapNum+1; gamemap = titleMapNum+1;
g_reloadingMap = false;
G_DoLoadLevelEx(true, GS_TITLESCREEN); G_DoLoadLevelEx(true, GS_TITLESCREEN);
if (!titlemap) if (!titlemap)
@ -1536,6 +1537,7 @@ void F_StartTitleScreen(void)
G_SetGamestate(GS_TITLESCREEN); G_SetGamestate(GS_TITLESCREEN);
titlemapinaction = false; titlemapinaction = false;
gamemap = 1; // g_game.c gamemap = 1; // g_game.c
g_reloadingMap = false;
CON_ClearHUD(); CON_ClearHUD();
} }

View file

@ -109,7 +109,8 @@ UINT32 mapmusposition; // Position to jump to
UINT32 mapmusresume; UINT32 mapmusresume;
UINT8 mapmusrng; // Random selection result UINT8 mapmusrng; // Random selection result
INT16 gamemap = 1; INT16 gamemap = 0;
boolean g_reloadingMap;
UINT32 maptol; UINT32 maptol;
preciptype_t globalweather = PRECIP_NONE; 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; gamemap = map;
automapactive = false; automapactive = false;

View file

@ -940,6 +940,7 @@ boolean K_StartCeremony(void)
&& mapheaderinfo[podiumMapNum]->lumpnum != LUMPERROR) && mapheaderinfo[podiumMapNum]->lumpnum != LUMPERROR)
{ {
gamemap = podiumMapNum+1; gamemap = podiumMapNum+1;
g_reloadingMap = false;
encoremode = grandprixinfo.encore; encoremode = grandprixinfo.encore;

View file

@ -6422,6 +6422,7 @@ static boolean P_NetUnArchiveMisc(savebuffer_t *save, boolean reloading)
gametic = READUINT32(save->p); gametic = READUINT32(save->p);
gamemap = READINT16(save->p); gamemap = READINT16(save->p);
g_reloadingMap = false;
// gamemap changed; we assume that its map header is always valid, // gamemap changed; we assume that its map header is always valid,
// so make it so // so make it so