From 1c54c639e466aec02914c4fb33b2dc9f54016b3e Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Fri, 23 Oct 2009 02:11:45 +0000 Subject: [PATCH] Ensure hero destination tile exists. Fixes bug 73. --- CCallback.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CCallback.cpp b/CCallback.cpp index 829b747a4..f41ab8404 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -842,6 +842,9 @@ const CGPathNode * CCallback::getPathInfo( int3 tile ) bool CCallback::getPath2( int3 dest, CGPath &ret ) { + if (!gs->map->isInTheMap(dest)) + return false; + const CGHeroInstance *h = cl->IGameCallback::getSelectedHero(player); assert(cl->pathInfo->hero == h); if(cl->pathInfo->hpos != h->getPosition(false)) //hero position changed, must update paths @@ -944,4 +947,4 @@ void InfoAboutTown::initFromTown( const CGTownInstance *t, bool detailed ) i->second.second = 0; } } -} \ No newline at end of file +}