Преглед на файлове

Blocked movement of war machines in tactics phase

Ivan Savenko преди 2 години
родител
ревизия
484f0a175a
променени са 2 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 2 0
      client/battle/BattleActionsController.cpp
  2. 4 1
      server/CGameHandler.cpp

+ 2 - 0
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);
 

+ 4 - 1
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
 	{