From bcb3db4cdcd716bf982666521870f95f22c17367 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Sun, 27 Jan 2013 14:25:44 -0200 Subject: [PATCH] Fix #250 --- src/client/localplayer.cpp | 2 +- src/client/map.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/localplayer.cpp b/src/client/localplayer.cpp index f7876e5f..cb9688f8 100644 --- a/src/client/localplayer.cpp +++ b/src/client/localplayer.cpp @@ -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; } diff --git a/src/client/map.cpp b/src/client/map.cpp index b908a5d5..772f394f 100644 --- a/src/client/map.cpp +++ b/src/client/map.cpp @@ -635,6 +635,13 @@ std::tuple, 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);