diff --git a/d_mapinfo.c b/d_mapinfo.c index 75ef02489..b44db8227 100644 --- a/d_mapinfo.c +++ b/d_mapinfo.c @@ -286,6 +286,8 @@ static void G_AddMapinfoKey(char* key, char* value, dmapinfo_t* mi) mi->songNum = S_SongForName(value); else if (!D_strcasecmp(key, "intermissionText")) mi->interText = value; + else if (!D_strcasecmp(key, "secretIntermissionText")) + mi->secretInterText = value; } static void G_FixSPCMDirList(dgameinfo_t *gi) @@ -484,6 +486,8 @@ dmapinfo_t **G_LoadMaplist(int *pmapcount, dgameinfo_t* gi) D_memset(mi, 0, sizeof(*mi)); mi->skyTexture = -1; mi->songNum = mus_none; + mi->interText = ""; + mi->secretInterText = ""; linecount = G_ParseMapinfo(zsection, (kvcall_t)&G_AddMapinfoKey, mi); if (linecount < 2 || mi->mapNumber <= 0) diff --git a/d_mapinfo.h b/d_mapinfo.h index 143f8a5f5..d9bcb7632 100644 --- a/d_mapinfo.h +++ b/d_mapinfo.h @@ -48,6 +48,7 @@ typedef struct char *secretNext; char *lumpName; char *interText; + char *secretInterText; } dmapinfo_t; typedef struct @@ -68,7 +69,6 @@ typedef struct VINT noAttractDemo; VINT stopFireTime; VINT titleStartPos; - char* interText; char* endText; void* data; } dgameinfo_t; diff --git a/f_main.c b/f_main.c index c8812b21e..a96c26513 100644 --- a/f_main.c +++ b/f_main.c @@ -622,9 +622,16 @@ void F_Drawer (void) if (!--fin->textdelay) { char str[2]; - const char *text = finale ? gameinfo.endText : gamemapinfo.interText; + const char *text; - if (!text) + if (finale) + text = gameinfo.endText; + else if (gameaction == ga_secretexit && *gamemapinfo.secretInterText) + text = gamemapinfo.secretInterText; + else + text = gamemapinfo.interText; + + if (!text || !*text) return; str[1] = 0; str[0] = text[fin->textindex]; diff --git a/g_game.c b/g_game.c index f16a81671..893f6b2fa 100644 --- a/g_game.c +++ b/g_game.c @@ -579,7 +579,7 @@ void G_RunGame (void) #ifdef JAGUAR int nextmap; #endif - boolean finale_ = false; + boolean finale_ = false, secretexit; /* run a level until death or completion */ MiniLoop(P_Start, P_Stop, P_Ticker, P_Drawer, P_Update); @@ -623,7 +623,8 @@ void G_RunGame (void) continue; /* skip intermission */ } - if (gameaction == ga_secretexit && gamemapinfo.secretNext) + secretexit = gameaction == ga_secretexit && gamemapinfo.secretNext; + if (secretexit) nextmapl = gamemapinfo.secretNext; else nextmapl = gamemapinfo.next; @@ -669,14 +670,15 @@ void G_RunGame (void) MiniLoop (IN_Start, IN_Stop, IN_Ticker, IN_Drawer, I_Update); /* run a text screen */ - if (gamemapinfo.interText && *gamemapinfo.interText && netgame != gt_deathmatch) - { + if (netgame != gt_deathmatch) + if (*gamemapinfo.secretInterText || *gamemapinfo.interText) + { #ifdef MARS - MiniLoop(F_Start, F_Stop, F_Ticker, F_Drawer, I_Update); + MiniLoop(F_Start, F_Stop, F_Ticker, F_Drawer, I_Update); #else - MiniLoop(F_Start, F_Stop, F_Ticker, F_Drawer, UpdateBuffer); + MiniLoop(F_Start, F_Stop, F_Ticker, F_Drawer, UpdateBuffer); #endif - } + } /* run the finale if needed */ finale = finale_;