From 484f0a175accc5f716a2829b5961081c2b19c9fc Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 30 Mar 2023 12:20:13 +0300 Subject: [PATCH] Blocked movement of war machines in tactics phase --- client/battle/BattleActionsController.cpp | 2 ++ server/CGameHandler.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/battle/BattleActionsController.cpp b/client/battle/BattleActionsController.cpp index 23842e9c5..2f48f2492 100644 --- a/client/battle/BattleActionsController.cpp +++ b/client/battle/BattleActionsController.cpp @@ -525,6 +525,8 @@ bool BattleActionsController::actionIsLegal(PossiblePlayerBattleAction action, B switch (action.get()) { case PossiblePlayerBattleAction::CHOOSE_TACTICS_STACK: + return (targetStack && targetStackOwned && targetStack->Speed() > 0); + case PossiblePlayerBattleAction::CREATURE_INFO: return (targetStack && targetStackOwned); diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index d8fadc640..9643b3bef 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1434,7 +1434,10 @@ int CGameHandler::moveStack(int stack, BattleHex dest) ret = path.second; - int creSpeed = gs->curB->tacticDistance ? GameConstants::BFIELD_SIZE : curStack->Speed(0, true); + int creSpeed = curStack->Speed(0, true); + + if (gs->curB->tacticDistance > 0 && creSpeed > 0) + creSpeed = GameConstants::BFIELD_SIZE; auto isGateDrawbridgeHex = [&](BattleHex hex) -> bool {