fix 'pwad endoom only' logic (#2138)

* fix 'pwad endoom only' logic

* fixed code formatting
This commit is contained in:
elf-alchemist 2025-01-10 12:13:38 -03:00 committed by GitHub
parent 8d87277247
commit 6cd8c4e2c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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