1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

CAdvMapInt::updateMoveHero: proper indeterminate check. Fix issue 2074

This commit is contained in:
Arseniy Shestakov
2016-01-15 19:30:43 +03:00
parent b84d7bd288
commit 530fe04c75

View File

@@ -758,14 +758,15 @@ void CAdvMapInt::updateSleepWake(const CGHeroInstance *h)
void CAdvMapInt::updateMoveHero(const CGHeroInstance *h, tribool hasPath)
{
//default value is for everywhere but CPlayerInterface::moveHero, because paths are not updated from there immediately
if (hasPath == boost::indeterminate)
hasPath = LOCPLINT->paths[h].nodes.size() ? true : false;
if (!h)
if(!h)
{
moveHero->block(true);
return;
}
//default value is for everywhere but CPlayerInterface::moveHero, because paths are not updated from there immediately
if(boost::logic::indeterminate(hasPath))
hasPath = LOCPLINT->paths[h].nodes.size() ? true : false;
moveHero->block(!hasPath || (h->movement == 0));
}