foxygit / doom Log in
commit c14396d9f4132b8d0866e0307be7a5085edd7ddb
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Aug 2 13:29:37 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Aug 2 13:29:37 2008 +0000

    Search for chex.deh in WAD path.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1169
---
 src/d_main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/d_main.c b/src/d_main.c
index 9aa85f9c..91ea48ef 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -774,15 +774,24 @@ void PrintGameVersion(void)

 static void LoadChexDeh(void)
 {
+    char *chex_deh;
+
     if (gameversion == exe_chex)
     {
-        if (!DEH_LoadFile("chex.deh"))
+        chex_deh = D_FindWADByName("chex.deh");
+
+        if (chex_deh == NULL)
         {
             I_Error("Unable to find Chex Quest dehacked file (chex.deh).\n"
                     "The dehacked file is required in order to emulate\n"
                     "chex.exe correctly.  Please download it from the\n"
                     "/idgames repository.");
         }
+
+        if (!DEH_LoadFile(chex_deh))
+        {
+            I_Error("Failed to load chex.deh needed for emulating chex.exe.");
+        }
     }
 }