mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
LILLIPUT: Fix another regression
This commit is contained in:
parent
92f739d53d
commit
b9e8320de7
@ -1404,7 +1404,11 @@ void LilliputEngine::homeInPathFinding(int index) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((enclosureDst != -1) && _enclosureRect->contains(_characterTargetPos[index])) {
|
||||
if ((enclosureDst != -1) &&
|
||||
(_characterTargetPos[index].x >= _enclosureRect[enclosureSrc].left) &&
|
||||
(_characterTargetPos[index].x <= _enclosureRect[enclosureSrc].right) &&
|
||||
(_characterTargetPos[index].y >= _enclosureRect[enclosureSrc].top) &&
|
||||
(_characterTargetPos[index].y <= _enclosureRect[enclosureSrc].bottom)) {
|
||||
_characterSubTargetPos[index] = _portalPos[enclosureDst];
|
||||
return;
|
||||
}
|
||||
@ -1507,10 +1511,10 @@ byte LilliputEngine::homeInAvoidDeadEnds(int indexb, int indexs) {
|
||||
if (idx == -1)
|
||||
return 1;
|
||||
|
||||
if (_enclosureRect[idx].contains(_curCharacterTilePos))
|
||||
if ((tmpPos.x >= _enclosureRect[idx].left) && (tmpPos.x <= _enclosureRect[idx].right) && (tmpPos.y >= _enclosureRect[idx].top) && (tmpPos.y <= _enclosureRect[idx].bottom))
|
||||
return 0;
|
||||
|
||||
if (_enclosureRect[idx].contains(_characterSubTargetPos[indexs]))
|
||||
if ((tmpPos.x >= _enclosureRect[idx].left) && (tmpPos.x <= _enclosureRect[idx].right) && (tmpPos.y >= _enclosureRect[idx].top) && (tmpPos.y <= _enclosureRect[idx].bottom))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
@ -1520,7 +1524,7 @@ int16 LilliputEngine::checkEnclosure(Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "checkEnclosure(%d, %d)", pos.x, pos.y);
|
||||
|
||||
for (int i = 0; i < _rectNumb; ++i) {
|
||||
if (_enclosureRect[i].contains(pos))
|
||||
if ((pos.x >= _enclosureRect[i].left) && (pos.x <= _enclosureRect[i].right) && (pos.y >= _enclosureRect[i].top) && (pos.y <= _enclosureRect[i].bottom))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
@ -1530,7 +1534,7 @@ int16 LilliputEngine::checkOuterEnclosure(Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "checkOuterEnclosure(%d, %d)", pos.x, pos.y);
|
||||
|
||||
for (int i = _rectNumb - 1; i >= 0 ; --i) {
|
||||
if (_enclosureRect[i].contains(pos))
|
||||
if ((pos.x >= _enclosureRect[i].left) && (pos.x <= _enclosureRect[i].right) && (pos.y >= _enclosureRect[i].top) && (pos.y <= _enclosureRect[i].bottom))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user