1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Blocked movement of war machines in tactics phase

This commit is contained in:
Ivan Savenko
2023-03-30 12:20:13 +03:00
parent 9e75568574
commit 484f0a175a
2 changed files with 6 additions and 1 deletions

View File

@@ -525,6 +525,8 @@ bool BattleActionsController::actionIsLegal(PossiblePlayerBattleAction action, B
switch (action.get()) switch (action.get())
{ {
case PossiblePlayerBattleAction::CHOOSE_TACTICS_STACK: case PossiblePlayerBattleAction::CHOOSE_TACTICS_STACK:
return (targetStack && targetStackOwned && targetStack->Speed() > 0);
case PossiblePlayerBattleAction::CREATURE_INFO: case PossiblePlayerBattleAction::CREATURE_INFO:
return (targetStack && targetStackOwned); return (targetStack && targetStackOwned);

View File

@@ -1434,7 +1434,10 @@ int CGameHandler::moveStack(int stack, BattleHex dest)
ret = path.second; 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 auto isGateDrawbridgeHex = [&](BattleHex hex) -> bool
{ {