From 6cd8c4e2c5ea580f1f66fe251af7d79bce9a2029 Mon Sep 17 00:00:00 2001 From: elf-alchemist Date: Fri, 10 Jan 2025 12:13:38 -0300 Subject: [PATCH] fix 'pwad endoom only' logic (#2138) * fix 'pwad endoom only' logic * fixed code formatting --- src/d_main.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 4db5c09d..2eea0b23 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1633,16 +1633,24 @@ static boolean AllowEndDoom(void) || exit_sequence == EXIT_SEQUENCE_ENDOOM_ONLY)); } -static boolean AllowEndDoomPWADOnly() { - return (!W_IsIWADLump(W_CheckNumForName("ENDOOM")) && endoom_pwad_only); -} - static void D_EndDoom(void) { - if (AllowEndDoom() && AllowEndDoomPWADOnly()) + // Do we even want to show an ENDOOM? + if (!AllowEndDoom()) { - D_ShowEndDoom(); + return; } + + // If so, is it from the IWAD? + bool iwad_endoom = W_IsIWADLump(W_CheckNumForName("ENDOOM")); + + // Does the user want to see it, in that case? + if (iwad_endoom && endoom_pwad_only) + { + return; + } + + D_ShowEndDoom(); } // [FG] fast-forward demo to the desired map