shithub: choc

Download patch

ref: 999f56818bcb45b48c22b0e21a74592ad7b80a14
parent: 533e3726f0fdeb0f679fedd96ab4877f80922456
author: Simon Howard <fraggle@soulsphere.org>
date: Tue Nov 22 18:45:14 EST 2016

doom: Load IWAD DEHs after setting gamevariant.

Certain IWADs (Freedoom and Hacx) contain DEHACKED lumps that must be
loaded to be played properly. This is conditional on the value of
gamevariant, but this variable was only being initialized for these
IWADs after the code to load the DEHACKED lumps. Reorder to correct.

--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1438,19 +1438,6 @@
     D_IdentifyVersion();
     InitGameVersion();
 
-    //!
-    // @category mod
-    //
-    // Disable automatic loading of Dehacked patches for certain
-    // IWAD files.
-    //
-    if (!M_ParmExists("-nodeh"))
-    {
-        // Some IWADs have dehacked patches that need to be loaded for
-        // them to be played properly.
-        LoadIwadDeh();
-    }
-
     // Check which IWAD variant we are using.
 
     if (W_CheckNumForName("FREEDOOM") >= 0)
@@ -1467,6 +1454,19 @@
     else if (W_CheckNumForName("DMENUPIC") >= 0)
     {
         gamevariant = bfgedition;
+    }
+
+    //!
+    // @category mod
+    //
+    // Disable automatic loading of Dehacked patches for certain
+    // IWAD files.
+    //
+    if (!M_ParmExists("-nodeh"))
+    {
+        // Some IWADs have dehacked patches that need to be loaded for
+        // them to be played properly.
+        LoadIwadDeh();
     }
 
     // Doom 3: BFG Edition includes modified versions of the classic