From 119d2e9e37ec60c5a729e4dd255a96f37be8d7b2 Mon Sep 17 00:00:00 2001
From: GoldenTails <milestailsprower101n2@gmail.com>
Date: Sun, 29 Nov 2020 16:53:29 -0600
Subject: [PATCH] Remove the rest of the Playing() checks for GameQuit hook

---
 src/d_clisrv.c    | 9 +++------
 src/d_netcmd.c    | 6 ++----
 src/m_menu.c      | 3 +--
 src/sdl/i_video.c | 3 +--
 4 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index 8951fe2040..52f091fee2 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -3026,8 +3026,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
 
 	if (pnum == consoleplayer)
 	{
-		if (Playing())
-			LUAh_GameQuit(false);
+		LUAh_GameQuit(false);
 #ifdef DUMPCONSISTENCY
 		if (msg == KICK_MSG_CON_FAIL) SV_SavedGame();
 #endif
@@ -3727,8 +3726,7 @@ static void HandleConnect(SINT8 node)
 static void HandleShutdown(SINT8 node)
 {
 	(void)node;
-	if (Playing())
-		LUAh_GameQuit(false);
+	LUAh_GameQuit(false);
 	D_QuitNetGame();
 	CL_Reset();
 	D_StartTitle();
@@ -3743,8 +3741,7 @@ static void HandleShutdown(SINT8 node)
 static void HandleTimeout(SINT8 node)
 {
 	(void)node;
-	if (Playing())
-		LUAh_GameQuit(false);
+	LUAh_GameQuit(false);
 	D_QuitNetGame();
 	CL_Reset();
 	D_StartTitle();
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index ec46aa4c39..7d5a598db3 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -3606,8 +3606,7 @@ static void Command_Playintro_f(void)
   */
 FUNCNORETURN static ATTRNORETURN void Command_Quit_f(void)
 {
-	if (Playing())
-		LUAh_GameQuit(true);
+	LUAh_GameQuit(true);
 	I_Quit();
 }
 
@@ -4269,8 +4268,7 @@ void Command_ExitGame_f(void)
 {
 	INT32 i;
 
-	if (Playing())
-		LUAh_GameQuit(false);
+	LUAh_GameQuit(false);
 
 	D_QuitNetGame();
 	CL_Reset();
diff --git a/src/m_menu.c b/src/m_menu.c
index 258b013187..5ec9132f74 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -6937,8 +6937,7 @@ static void M_SelectableClearMenus(INT32 choice)
 static void M_UltimateCheat(INT32 choice)
 {
 	(void)choice;
-	if (Playing())
-		LUAh_GameQuit(true);
+	LUAh_GameQuit(true);
 	I_Quit();
 }
 
diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index 310275d551..5ebff87001 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -1057,8 +1057,7 @@ void I_GetEvent(void)
 					M_SetupJoystickMenu(0);
 			 	break;
 			case SDL_QUIT:
-				if (Playing())
-					LUAh_GameQuit(true);
+				LUAh_GameQuit(true);
 				I_Quit();
 				break;
 		}
-- 
GitLab