浏览代码

Do not attempt to move if there are active dialogs

Ivan Savenko 1 年之前
父节点
当前提交
2f1f68f89d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      client/HeroMovementController.cpp

+ 2 - 1
client/HeroMovementController.cpp

@@ -22,6 +22,7 @@
 
 #include "../CCallback.h"
 
+#include "../lib/CondSh.h"
 #include "../lib/pathfinder/CGPathNode.h"
 #include "../lib/mapObjects/CGHeroInstance.h"
 #include "../lib/networkPacks/PacksForClient.h"
@@ -233,7 +234,7 @@ void HeroMovementController::onMoveHeroApplied()
 	assert(currentlyMovingHero);
 	const auto * hero = currentlyMovingHero;
 
-	bool canMove = LOCPLINT->localState->hasPath(hero) && LOCPLINT->localState->getPath(hero).nextNode().turns == 0;
+	bool canMove = LOCPLINT->localState->hasPath(hero) && LOCPLINT->localState->getPath(hero).nextNode().turns == 0 && !LOCPLINT->showingDialog->get();
 	bool wantStop = stoppingMovement;
 	bool canStop = !canMove || canHeroStopAtNode(LOCPLINT->localState->getPath(hero).currNode());