From aa5f2230510a41bbe226c27f8471c758e7079e30 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Jun 2013 18:34:57 +0200 Subject: [PATCH] - added _mental_'s patch for loading .deh/.bex files if no Dehacked lump can be found. --- src/d_dehacked.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 4239ae3d3b..dd00000438 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2337,6 +2337,28 @@ int D_LoadDehLumps() { count += D_LoadDehLump(lumpnum); } + + if (0 == PatchSize) + { + // No DEH/BEX patch is loaded yet, try to find lump(s) with specific extensions + + for (lumpnum = 0, lastlump = Wads.GetNumLumps(); + lumpnum < lastlump; + ++lumpnum) + { + const char* const fullName = Wads.GetLumpFullName(lumpnum); + const char* const extension = strrchr(fullName, '.'); + + const bool isDehOrBex = NULL != extension + && (0 == stricmp(extension, ".deh") || 0 == stricmp(extension, ".bex")); + + if (isDehOrBex) + { + count += D_LoadDehLump(lumpnum); + } + } + } + return count; }