Fix #250
This commit is contained in:
parent
e81dd31ae3
commit
bcb3db4cdc
|
@ -195,7 +195,7 @@ bool LocalPlayer::autoWalk(const Position& destination)
|
||||||
// no known path found, try to discover one
|
// no known path found, try to discover one
|
||||||
result = g_map.findPath(m_position, destination, 1000, Otc::PathFindAllowNotSeenTiles);
|
result = g_map.findPath(m_position, destination, 1000, Otc::PathFindAllowNotSeenTiles);
|
||||||
if(std::get<1>(result) != Otc::PathFindResultOk) {
|
if(std::get<1>(result) != Otc::PathFindResultOk) {
|
||||||
callLuaField("onAutoWalkFail");
|
callLuaField("onAutoWalkFail", std::get<1>(result));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -635,6 +635,13 @@ std::tuple<std::vector<Otc::Direction>, Otc::PathFindResult> Map::findPath(const
|
||||||
if(!(flags & Otc::PathFindAllowNonWalkable) && isNotWalkable)
|
if(!(flags & Otc::PathFindAllowNonWalkable) && isNotWalkable)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if(!(flags & Otc::PathFindAllowNotSeenTiles) && !wasSeen)
|
||||||
|
continue;
|
||||||
|
if(wasSeen) {
|
||||||
|
if(!(flags & Otc::PathFindAllowNonWalkable) && isNotWalkable)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Otc::Direction walkDir = currentNode->pos.getDirectionFromPosition(neighborPos);
|
Otc::Direction walkDir = currentNode->pos.getDirectionFromPosition(neighborPos);
|
||||||
|
|
Loading…
Reference in New Issue