diff options
author | Eugene Sandulenko | 2016-07-15 19:31:18 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 2e0078ef0640dc237b0681e03f06824bffd9be10 (patch) | |
tree | 328b9c6db9be650a452ec0a0d1027fefb73b8da3 | |
parent | 78b198cee9920e62ea19879959316b426fe1834c (diff) | |
download | scummvm-rg350-2e0078ef0640dc237b0681e03f06824bffd9be10.tar.gz scummvm-rg350-2e0078ef0640dc237b0681e03f06824bffd9be10.tar.bz2 scummvm-rg350-2e0078ef0640dc237b0681e03f06824bffd9be10.zip |
DIRECTOR: Lingo: Fix line counting in code chunks
-rw-r--r-- | engines/director/lingo/lingo.cpp | 4 | ||||
-rw-r--r-- | engines/director/lingo/tests/factory.lingo | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 8302c5996e..2c2583699e 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -163,7 +163,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { begin = code; first = false; } - Common::String chunk(begin, end - 1); + Common::String chunk(begin, end); if (chunk.hasPrefix("factory") || chunk.hasPrefix("method")) _inFactory = true; @@ -182,6 +182,8 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { } _hadError = true; // HACK: This is for preventing test execution + + debug(2, "Code chunk:\n#####\n%s#####", begin); parse(begin); } else { parse(code); diff --git a/engines/director/lingo/tests/factory.lingo b/engines/director/lingo/tests/factory.lingo index 048bb606a1..cf1e142088 100644 --- a/engines/director/lingo/tests/factory.lingo +++ b/engines/director/lingo/tests/factory.lingo @@ -26,7 +26,7 @@ method mExit method mDispose global aim1 set aim1 = 1 - when keydown then nothing +-- when keydown then nothing -- factory fire2 method mNew @@ -41,8 +41,8 @@ method mAtFrame set the castnum of sprite 14 to f16 set the perframehook to false me(hit) --- exit - end if + exit +-- end if if startV < targetV or bcast>g17 then set the perframehook to false set the locV of sprite 14 to 340 |