mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Lazy updates of hero paths.
This commit is contained in:
@@ -312,7 +312,7 @@ bool CCallback::getPath2( int3 dest, CGPath &ret )
|
||||
|
||||
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
|
||||
if(cl->pathInfo->hpos != h->getPosition(false) || !cl->pathInfo->isValid) //hero position changed, must update paths
|
||||
{
|
||||
recalculatePaths();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user