diff options
author | Eugene Sandulenko | 2019-12-08 15:34:53 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-08 15:34:53 +0100 |
commit | 31c26010e3d397824547f5db6a4def9ca929ceb2 (patch) | |
tree | 249323632405edad4df9076c19af75e266db3328 | |
parent | 17d4a24366aa4b74195253f1ac44bcc63593779f (diff) | |
download | scummvm-rg350-31c26010e3d397824547f5db6a4def9ca929ceb2.tar.gz scummvm-rg350-31c26010e3d397824547f5db6a4def9ca929ceb2.tar.bz2 scummvm-rg350-31c26010e3d397824547f5db6a4def9ca929ceb2.zip |
DIRECTOR: LINGO: Fix one-leg if codegen
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index eda6469014..44683897a3 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -398,6 +398,7 @@ void Lingo::processIf(int startlabel, int endlabel, int finalElse) { WRITE_UINT32(&iend, endlabel); int finalElsePos = -1; + bool multiIf = _labelstack.size() > 1; while (true) { if (_labelstack.empty()) { @@ -430,7 +431,7 @@ void Lingo::processIf(int startlabel, int endlabel, int finalElse) { else1 = label; } - if (finalElsePos != -1) { + if (multiIf && finalElsePos != -1) { debugC(4, kDebugLingoCompile, "processIf: storing %d to %d", finalElse - finalElsePos + startlabel, finalElsePos); WRITE_UINT32(&ielse1, finalElse - finalElsePos + startlabel); (*_currentScript)[finalElsePos + 2] = ielse1; |