DIRECTOR: LINGO: Preprocess 'play done' to 'play #done'

This commit is contained in:
Eugene Sandulenko 2020-03-28 21:51:49 +01:00
parent e570423595
commit 8a5396e6f5
2 changed files with 8 additions and 4 deletions

View File

@ -295,8 +295,12 @@ void Lingo::func_play(Datum &frame, Datum &movie) {
return;
}
// play "done"
if (frame.type == STRING) {
// play #done
if (frame.type == SYMBOL) {
if (!frame.u.s->equals("#done")) {
warning("Lingo::func_play: unknown symbol: %s", frame.u.s->c_str());
return;
}
if (_vm->_movieStack.empty()) { // No op if no nested movies
return;
}

View File

@ -387,10 +387,10 @@ Common::String preprocessPlay(Common::String in) {
debugC(2, kDebugLingoParse, "PLAY: nexttok: %s", next.c_str());
if (next.equals("done")) {
res += "\"done\""; // Turn it into STRING
res += "#"; // Turn it into SYMBOL
}
ptr += 4; // Skip "done"
res += *ptr++; // We advance one character, so 'one' is left
beg = ptr;
}