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++;