From 0466837b678b90360e3479fbb3aa76625f64a6c0 Mon Sep 17 00:00:00 2001 From: danij Date: Wed, 22 Aug 2012 14:54:03 +0100 Subject: [PATCH] Deh Reader: The BEX "include" directive should be ignored in patch lumps --- doomsday/plugins/dehread/include/dehreader.h | 3 ++- doomsday/plugins/dehread/src/dehread.cpp | 2 +- doomsday/plugins/dehread/src/dehreader.cpp | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doomsday/plugins/dehread/include/dehreader.h b/doomsday/plugins/dehread/include/dehreader.h index b565cd6840..65f1d74e2f 100644 --- a/doomsday/plugins/dehread/include/dehreader.h +++ b/doomsday/plugins/dehread/include/dehreader.h @@ -36,7 +36,8 @@ /// Flags used with @see readDehPatch() to alter read behavior. enum DehReaderFlag { - NoText = 0x1 ///< Ignore Text patches. + NoInclude = 0x1, ///< Including of other patch files is disabled. + NoText = 0x2 ///< Ignore Text patches. }; Q_DECLARE_FLAGS(DehReaderFlags, DehReaderFlag) diff --git a/doomsday/plugins/dehread/src/dehread.cpp b/doomsday/plugins/dehread/src/dehread.cpp index 9a7d6234a4..7a397acb7b 100644 --- a/doomsday/plugins/dehread/src/dehread.cpp +++ b/doomsday/plugins/dehread/src/dehread.cpp @@ -84,7 +84,7 @@ static void readLump(lumpnum_t lumpNum) Con_Message("Applying DeHackEd patch lump #%i \"%s:%s\"...\n", lumpNum, F_PrettyPath(W_LumpSourceFile(lumpNum)), W_LumpName(lumpNum)); - readDehPatch(deh); + readDehPatch(deh, NoInclude); } static void readFile(const String& filePath) diff --git a/doomsday/plugins/dehread/src/dehreader.cpp b/doomsday/plugins/dehread/src/dehreader.cpp index 182c753b9a..f2bf17f33f 100644 --- a/doomsday/plugins/dehread/src/dehreader.cpp +++ b/doomsday/plugins/dehread/src/dehreader.cpp @@ -578,6 +578,13 @@ class DehReader void parseInclude(QString& arg) { + if(flags & NoInclude) + { + LOG_AS("parseInclude"); + LOG_DEBUG("Skipping disabled Include directive."); + return; + } + if(stackDepth > maxIncludeDepth) { LOG_AS("parseInclude");