Skip to content

Commit

Permalink
DIRECTOR: Lingo: Fix line counting in code chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 3, 2016
1 parent 78b198c commit 2e0078e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion engines/director/lingo/lingo.cpp
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions engines/director/lingo/tests/factory.lingo
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2e0078e

Please sign in to comment.