summaryrefslogtreecommitdiff
path: root/src/doom
diff options
context:
space:
mode:
authorSimon Howard2014-09-13 03:55:00 -0400
committerSimon Howard2014-09-13 03:55:00 -0400
commitcb72358ee930b29f4840b04bbb81f8d8444ce481 (patch)
treec2b9865637b9cbd93e53e1cc7c26d4553dc4a203 /src/doom
parent9531cdfcfadc0d4c2b767f27238bc9ac742787e0 (diff)
downloadchocolate-doom-cb72358ee930b29f4840b04bbb81f8d8444ce481.tar.gz
chocolate-doom-cb72358ee930b29f4840b04bbb81f8d8444ce481.tar.bz2
chocolate-doom-cb72358ee930b29f4840b04bbb81f8d8444ce481.zip
dehacked: Load Freedoom DEHACKED lump on startup.
If using one of the Freedoom IWADs, detect it by checking for the FREEDOOM lump, and then load its DEHACKED lump to apply the cosmetic string changes that it includes. In case we're using an old version of one of the Freedoom IWADs, don't bomb out with an error while parsing the DEHACKED lump.
Diffstat (limited to 'src/doom')
-rw-r--r--src/doom/d_main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 4c1092ac..d4859b30 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1066,7 +1066,7 @@ static void LoadHacxDeh(void)
if (gameversion == exe_hacx)
{
- if (!DEH_LoadLumpByName("DEHACKED", true))
+ if (!DEH_LoadLumpByName("DEHACKED", true, false))
{
I_Error("DEHACKED lump not found. Please check that this is the "
"Hacx v1.2 IWAD.");
@@ -1299,6 +1299,16 @@ void D_DoomMain (void)
W_CheckCorrectIWAD(doom);
+ // The Freedoom IWADs have DEHACKED lumps with cosmetic changes to the
+ // in-game messages. Load this.
+ // Old versions of Freedoom (before 2014-09) did not have technically
+ // valid DEHACKED lumps, so ignore errors and just continue if this
+ // is an old IWAD.
+ if (W_CheckNumForName("FREEDOOM") >= 0)
+ {
+ DEH_LoadLumpByName("DEHACKED", false, true);
+ }
+
// Doom 3: BFG Edition includes modified versions of the classic
// IWADs which can be identified by an additional DMENUPIC lump.
// Furthermore, the M_GDHIGH lumps have been modified in a way that
@@ -1461,7 +1471,7 @@ void D_DoomMain (void)
{
if (!strncmp(lumpinfo[i].name, "DEHACKED", 8))
{
- DEH_LoadLump(i, false);
+ DEH_LoadLump(i, false, false);
loaded++;
}
}