Skip to content

Commit

Permalink
LILLIPUT: Fix a bug in OC_for
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and sev- committed Mar 28, 2018
1 parent 977c07b commit 7948696
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions engines/lilliput/script.cpp
Expand Up @@ -99,7 +99,7 @@ byte LilliputScript::handleOpcodeType1(int curWord) {
return OC_getRandom();
break;
case 0x6:
return OC_sub1748C();
return OC_for();
break;
case 0x7:
return OC_compWord18776();
Expand Down Expand Up @@ -960,8 +960,8 @@ byte LilliputScript::OC_getRandom() {
return 0;
}

byte LilliputScript::OC_sub1748C() {
debugC(1, kDebugScript, "OC_sub1748C()");
byte LilliputScript::OC_for() {
debugC(1, kDebugScript, "OC_for()");

int var1 = _currScript->readUint16LE();
int tmpVal = _currScript->readUint16LE() + 1;
Expand All @@ -971,6 +971,7 @@ byte LilliputScript::OC_sub1748C() {
if (tmpVal < var1)
return 0;

_currScript->writeUint16LE(0, -2);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/lilliput/script.h
Expand Up @@ -122,7 +122,7 @@ class LilliputScript {
byte OC_sub17434();
byte OC_sub17468();
byte OC_getRandom();
byte OC_sub1748C();
byte OC_for();
byte OC_compWord18776();
byte OC_checkSaveFlag();
byte OC_sub174C8();
Expand Down

0 comments on commit 7948696

Please sign in to comment.