This commit is contained in:
Eduardo Bart 2013-01-27 14:25:44 -02:00
parent e81dd31ae3
commit bcb3db4cdc
2 changed files with 8 additions and 1 deletions

View File

@ -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;
} }

View File

@ -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);