mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Ensure hero destination tile exists. Fixes bug 73.
This commit is contained in:
@@ -842,6 +842,9 @@ const CGPathNode * CCallback::getPathInfo( int3 tile )
|
|||||||
|
|
||||||
bool CCallback::getPath2( int3 dest, CGPath &ret )
|
bool CCallback::getPath2( int3 dest, CGPath &ret )
|
||||||
{
|
{
|
||||||
|
if (!gs->map->isInTheMap(dest))
|
||||||
|
return false;
|
||||||
|
|
||||||
const CGHeroInstance *h = cl->IGameCallback::getSelectedHero(player);
|
const CGHeroInstance *h = cl->IGameCallback::getSelectedHero(player);
|
||||||
assert(cl->pathInfo->hero == h);
|
assert(cl->pathInfo->hero == h);
|
||||||
if(cl->pathInfo->hpos != h->getPosition(false)) //hero position changed, must update paths
|
if(cl->pathInfo->hpos != h->getPosition(false)) //hero position changed, must update paths
|
||||||
|
Reference in New Issue
Block a user