From f62032ac6ab2af035a4c5989c08181d033bab945 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Sep 2007 08:02:57 +0000 Subject: [PATCH] - fixed: The #include command in DECORATE always tried to look up the name as a normal WAD lump name. It only should do that if the name is not longer than 8 characters and doesn't contain any '/'-characters. SVN r546 (trunk) --- docs/rh-log.txt | 5 +++++ src/thingdef/thingdef_main.cpp | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 4844aaae1..d0c3e6e72 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,8 @@ +September 23, 2007 (Changes by Graf Zahl) +- fixed: The #include command in DECORATE always tried to look up the name + as a normal WAD lump name. It only should do that if the name is not longer + than 8 characters and doesn't contain any '/'-characters. + September 11, 2007 (Changes by Graf Zahl) - fixed: The Timidity player didn't close its temporary files and left them behind because it couldn't delete them. diff --git a/src/thingdef/thingdef_main.cpp b/src/thingdef/thingdef_main.cpp index 52c393b4a..e9f6cc01a 100644 --- a/src/thingdef/thingdef_main.cpp +++ b/src/thingdef/thingdef_main.cpp @@ -88,8 +88,15 @@ static void ParseDecorate () SC_MustGetString(); // This is not using SC_Open because it can print a more useful error message when done here lump = Wads.CheckNumForFullName(sc_String); - if (lump==-1) lump = Wads.CheckNumForName(sc_String); - if (lump==-1) SC_ScriptError("Lump '%s' not found", sc_String); + + // Try a normal WAD name lookup only if it's a proper name without path separator and + // not longer than 8 characters. + if (lump==-1 && strlen(sc_String) <= 8 && !strchr(sc_String, '/')) + lump = Wads.CheckNumForName(sc_String); + + if (lump==-1) + SC_ScriptError("Lump '%s' not found", sc_String); + SC_SaveScriptState(); SC_OpenLumpNum(lump, sc_String); recursion++;