浏览代码

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

Arseniy Shestakov 9 年之前
父节点
当前提交
530fe04c75
共有 1 个文件被更改,包括 5 次插入4 次删除
  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)
 {
-	//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));
 }