aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2018-04-29 00:55:18 +0200
committerStrangerke2018-04-29 00:55:52 +0200
commitb9e8320de7830a72c75ce7a3134aee162f27bfe2 (patch)
tree8df2ad431dcaf25de0709c0d9b4373c9ff532d1c /engines/lilliput
parent92f739d53d090998dbce2951ba44570a0ea1937a (diff)
downloadscummvm-rg350-b9e8320de7830a72c75ce7a3134aee162f27bfe2.tar.gz
scummvm-rg350-b9e8320de7830a72c75ce7a3134aee162f27bfe2.tar.bz2
scummvm-rg350-b9e8320de7830a72c75ce7a3134aee162f27bfe2.zip
LILLIPUT: Fix another regression
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index eb93516bed..e41ec36067 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -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;