From 4307acdcc89a425581ccb255788319d585c5a074 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 6 Mar 2017 20:34:04 +0100 Subject: DIRECTOR: Lingo: Split 'on ...' statement when preprocessing D4 scripts do not have respective 'end...' statement, which leads to syntax errors. Now we are preprocessing those as well. --- engines/director/lingo/lingo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'engines/director/lingo') diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 5775eb13bc..706f76777d 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -140,6 +140,11 @@ const char *Lingo::findNextDefinition(const char *s) { return res; } + if (!strncmp(res, "on ", 3)) { + debugC(1, kDebugLingoCompile, "See on"); + return res; + } + if (!strncmp(res, "factory ", 8)) { debugC(1, kDebugLingoCompile, "See factory"); return res; @@ -195,7 +200,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { if (chunk.hasPrefix("factory") || chunk.hasPrefix("method")) _inFactory = true; - else if (chunk.hasPrefix("macro")) + else if (chunk.hasPrefix("macro") || chunk.hasPrefix("on")) _inFactory = false; else _inFactory = false; -- cgit v1.2.3