diff options
author | Simon Howard | 2014-03-16 02:34:35 -0400 |
---|---|---|
committer | Simon Howard | 2014-03-16 02:34:35 -0400 |
commit | fdd80a8054e0193bf0ad2d999acb46920c575c14 (patch) | |
tree | be1092c847ba00c6f0b648b439fdc2a53b4b0d1b /src/doom | |
parent | 6b624639374600c50e72b435a5d4ce0fe2f7a1a1 (diff) | |
download | chocolate-doom-fdd80a8054e0193bf0ad2d999acb46920c575c14.tar.gz chocolate-doom-fdd80a8054e0193bf0ad2d999acb46920c575c14.tar.bz2 chocolate-doom-fdd80a8054e0193bf0ad2d999acb46920c575c14.zip |
doom: Fix behavior of M_EPI4 menu item.
Ultimate Doom's doom.exe will crash when run with an IWAD that doesn't
contain M_EPI4 (like the stock v1.9 IWAD).
Thanks to Alexandre Xavier for the bug report (fixes #344).
Diffstat (limited to 'src/doom')
-rw-r--r-- | src/doom/m_menu.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c index 306a139f..85a0cd76 100644 --- a/src/doom/m_menu.c +++ b/src/doom/m_menu.c @@ -2113,8 +2113,6 @@ void M_Init (void) // Episode 2 and 3 are handled, // branching to an ad screen. case registered: - // We need to remove the fourth episode. - EpiDef.numitems--; break; case retail: // We are fine. @@ -2122,6 +2120,15 @@ void M_Init (void) break; } + // Versions of doom.exe before the Ultimate Doom release only had + // three episodes; if we're emulating one of those then don't try + // to show episode four. If we are, then do show episode four + // (should crash if missing). + if (gameversion < exe_ultimate) + { + EpiDef.numitems--; + } + opldev = M_CheckParm("-opldev") > 0; } |