Eduardo Bart 11 years ago
parent e81dd31ae3
commit bcb3db4cdc

@ -195,7 +195,7 @@ bool LocalPlayer::autoWalk(const Position& destination)
// no known path found, try to discover one
result = g_map.findPath(m_position, destination, 1000, Otc::PathFindAllowNotSeenTiles);
if(std::get<1>(result) != Otc::PathFindResultOk) {
callLuaField("onAutoWalkFail");
callLuaField("onAutoWalkFail", std::get<1>(result));
return false;
}

@ -635,6 +635,13 @@ std::tuple<std::vector<Otc::Direction>, Otc::PathFindResult> Map::findPath(const
if(!(flags & Otc::PathFindAllowNonWalkable) && isNotWalkable)
continue;
}
} else {
if(!(flags & Otc::PathFindAllowNotSeenTiles) && !wasSeen)
continue;
if(wasSeen) {
if(!(flags & Otc::PathFindAllowNonWalkable) && isNotWalkable)
continue;
}
}
Otc::Direction walkDir = currentNode->pos.getDirectionFromPosition(neighborPos);

Loading…
Cancel
Save