TSAGE: Fixed problem in pathfinding when clicked position is outside walkable areas

This commit is contained in:
Paul Gilbert 2011-04-30 16:31:09 +10:00
parent 410367ced0
commit 5cbf6347d1

View File

@ -3310,7 +3310,7 @@ void WalkRegions::loadRevised() {
*/
int WalkRegions::indexOf(const Common::Point &pt, const Common::List<int> *indexList) {
for (uint idx = 0; idx < _regionList.size(); ++idx) {
if ((!indexList || contains(*indexList, int(idx + 1))) && _regionList[idx].contains(pt))
if ((!indexList || !contains(*indexList, int(idx + 1))) && _regionList[idx].contains(pt))
return idx + 1;
}