Skip to content

Commit

Permalink
LILLIPUT: Minor fixes
Browse files Browse the repository at this point in the history
Prevents unexpected values in sub16626
  • Loading branch information
sylvaintv authored and sev- committed Mar 28, 2018
1 parent 16ec550 commit c6ee25b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions engines/lilliput/lilliput.cpp
Expand Up @@ -1010,12 +1010,12 @@ void LilliputEngine::sub16626() {
while (index >= 0) {
result = 0;
while (result != 2) {
int var2 = _scriptHandler->_array12811[index];
int var2 = _scriptHandler->_array12811[index] & 0xFF;
if (var2 == 16)
break;
var2 = (var2 * 2) + (index << 5);
var2 = var2 + (index << 4);
int var1 = _scriptHandler->_array12311[var2];
var2 = ((var2 & 0xFF00) + (var1 >> 8)) >> 3;
var2 = (var1 >> 8) >> 3;
var2 &= 0xFE;

// temporary hack
Expand Down
6 changes: 4 additions & 2 deletions engines/lilliput/script.cpp
Expand Up @@ -1339,11 +1339,13 @@ void LilliputScript::OC_sub17D57() {
debugC(1, kDebugScript, "OC_sub17D57()");

int curWord = _currScript->readUint16LE();
curWord = sub17D40(curWord);

_word1881B = _vm->_rulesBuffer2PrevIndx;
if((_byte16F08 == 1) || (_array16173[_vm->_rulesBuffer2PrevIndx] == 0xFF))
return;

_word1881B = _vm->_rulesBuffer2PrevIndx;
sub18B3C(curWord);

}

void LilliputScript::OC_sub17D7F() {
Expand Down
2 changes: 1 addition & 1 deletion engines/lilliput/script.h
Expand Up @@ -48,7 +48,7 @@ class LilliputScript {
int _word10802;
int _word1881B;

int _array12311[640];
short _array12311[640];

LilliputScript(LilliputEngine *vm);
~LilliputScript();
Expand Down

0 comments on commit c6ee25b

Please sign in to comment.