- added _mental_'s patch for loading .deh/.bex files if no Dehacked lump can be found.

This commit is contained in:
Christoph Oelckers 2013-06-23 18:34:57 +02:00
parent d8abeceef9
commit aa5f223051

View file

@ -2337,6 +2337,28 @@ int D_LoadDehLumps()
{ {
count += D_LoadDehLump(lumpnum); 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; return count;
} }