From eea7dc4224e8e016f44de83e07515f2b712ed88f Mon Sep 17 00:00:00 2001
From: toasterbabe <rollerorbital@gmail.com>
Date: Tue, 28 Mar 2017 17:54:54 +0100
Subject: [PATCH] Fixed titlemap wipe lasting too long/happening twice over

---
 src/d_main.c   | 2 +-
 src/f_finale.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/d_main.c b/src/d_main.c
index 4fb55d7284..e2cb35f329 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -302,7 +302,7 @@ static void D_Display(void)
 		if (rendermode != render_none)
 		{
 			// Fade to black first
-			if (gamestate != GS_LEVEL // fades to black on its own timing, always
+			if (!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)) // fades to black on its own timing, always
 			 && wipedefs[wipedefindex] != UINT8_MAX)
 			{
 				F_WipeStartScreen();
diff --git a/src/f_finale.c b/src/f_finale.c
index 9959ce0fc1..50c94eec3c 100644
--- a/src/f_finale.c
+++ b/src/f_finale.c
@@ -1429,6 +1429,7 @@ void F_StartTitleScreen(void)
 
 	if (titlemap)
 	{
+		gamestate_t prevwipegamestate = wipegamestate;
 		titlemapinaction = true;
 		gamemap = titlemap;
 
@@ -1439,6 +1440,8 @@ void F_StartTitleScreen(void)
 		players[displayplayer].playerstate = PST_DEAD; // Don't spawn the player in dummy (I'm still a filthy cheater)
 		camera.subsector = NULL; // toast is filthy too
 		//CON_ClearHUD();
+
+		wipegamestate = prevwipegamestate;
 	}
 	else
 	{
-- 
GitLab