1
0
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:
Michał W. Urbańczyk
2011-09-03 02:54:33 +00:00
parent 5072bda7e6
commit 6b9e64de91
7 changed files with 27 additions and 28 deletions

View File

@@ -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();
}