Skip to content

Commit

Permalink
Deh Reader: The BEX "include" directive should be ignored in patch lumps
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Aug 22, 2012
1 parent a1a7e80 commit 0466837
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion doomsday/plugins/dehread/include/dehreader.h
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/dehread/src/dehread.cpp
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions doomsday/plugins/dehread/src/dehreader.cpp
Expand Up @@ -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");
Expand Down

0 comments on commit 0466837

Please sign in to comment.