Skip to content

Commit

Permalink
LILLIPUT: fix a bug in OC_sub17D04
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and sev- committed Mar 28, 2018
1 parent 8d25611 commit 0eea144
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions engines/lilliput/lilliput.cpp
Expand Up @@ -2746,6 +2746,7 @@ void LilliputEngine::initialize() {
byte *LilliputEngine::getCharacterVariablesPtr(int16 index) {
debugC(1, kDebugEngine, "getCharacterVariablesPtr(%d)", index);

assert((index > -3120) && (index < 1400));
if (index >= 0)
return &_characterVariables_[index];
else
Expand Down
6 changes: 2 additions & 4 deletions engines/lilliput/script.cpp
Expand Up @@ -1372,8 +1372,6 @@ byte *LilliputScript::getCharacterVariablePtr() {
int index = tmpVal * 32;
index += _currScript->readUint16LE();

assert(index < 1400);

return _vm->getCharacterVariablesPtr(index);
}

Expand Down Expand Up @@ -2979,10 +2977,10 @@ void LilliputScript::OC_sub18367() {
void LilliputScript::OC_sub17D04() {
debugC(1, kDebugScript, "OC_sub17D04()");

byte var1 = getValue1();
int16 index = getValue1();
byte var2 = _currScript->readUint16LE() & 0xFF;

sub1823E(var1, var2, _vm->getCharacterVariablesPtr(var1));
sub1823E(index, var2, _vm->getCharacterVariablesPtr(index * 32));
}

void LilliputScript::OC_sub18387() {
Expand Down

0 comments on commit 0eea144

Please sign in to comment.