Sfoglia il codice sorgente

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

Arseniy Shestakov 9 anni fa
parent
commit
530fe04c75
1 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. 5 4
      client/windows/CAdvmapInterface.cpp

+ 5 - 4
client/windows/CAdvmapInterface.cpp

@@ -758,14 +758,15 @@ void CAdvMapInt::updateSleepWake(const CGHeroInstance *h)
 
 
 void CAdvMapInt::updateMoveHero(const CGHeroInstance *h, tribool hasPath)
 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);
 		moveHero->block(true);
 		return;
 		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));
 	moveHero->block(!hasPath || (h->movement == 0));
 }
 }