Skip to content

Commit

Permalink
LILLIPUT: Fix regression introduced in 56db8c6
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Apr 26, 2018
1 parent beeddc8 commit ef1b017
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions engines/lilliput/lilliput.cpp
Expand Up @@ -1423,9 +1423,9 @@ void LilliputEngine::homeInPathFinding(int index) {
}

if (_enclosureRect[enclosureSrc].bottom != _enclosureRect[enclosureSrc].top) {
if (_portalPos[enclosureSrc].y == _enclosureRect[enclosureSrc].bottom)
if (_portalPos[enclosureSrc].y == _enclosureRect[enclosureSrc].top)
_characterSubTargetPos[index] = Common::Point(_portalPos[enclosureSrc].x, _portalPos[enclosureSrc].y - 1);
else // CHECKME: Should be a check on y == top
else // CHECKME: Should be a check on y == bottom
_characterSubTargetPos[index] = Common::Point(_portalPos[enclosureSrc].x, _portalPos[enclosureSrc].y + 1);

return;
Expand Down Expand Up @@ -2573,8 +2573,8 @@ void LilliputEngine::loadRules() {
for (int i = 0; i < _rectNumb; i++) {
_enclosureRect[i].right = (int16)f.readByte();
_enclosureRect[i].left = (int16)f.readByte();
_enclosureRect[i].top = (int16)f.readByte();
_enclosureRect[i].bottom = (int16)f.readByte();
_enclosureRect[i].top = (int16)f.readByte();

int16 tmpValY = (int16)f.readByte();
int16 tmpValX = (int16)f.readByte();
Expand Down
6 changes: 3 additions & 3 deletions engines/lilliput/script.cpp
Expand Up @@ -1534,10 +1534,10 @@ byte LilliputScript::OC_compareCoords_1() {
byte LilliputScript::OC_compareCoords_2() {
debugC(1, kDebugScript, "OC_compareCoords_2()");

int16 index = getValue1();
index = _currScript->readUint16LE();
int16 idx1 = getValue1();
int16 idx2 = _currScript->readUint16LE();

if (_vm->_enclosureRect[index].contains(_characterTilePos[index]))
if (_vm->_enclosureRect[idx2].contains(_characterTilePos[idx1]))
return 1;
return 0;
}
Expand Down

0 comments on commit ef1b017

Please sign in to comment.