1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Merge pull request #6004 from thehonestcto/fix/highlighted-hexes

fix: placing a single hex unit during tactics into a hex which is blo…
This commit is contained in:
Ivan Savenko
2025-08-14 10:52:15 +03:00
committed by GitHub

View File

@@ -375,15 +375,15 @@ BattleHexArray BattleFieldController::getHighlightedHexesForMovementTarget()
auto hoveredStack = owner.getBattle()->battleGetStackByPos(hoveredHex, true);
if(isTileAttackable(hoveredHex))
if(owner.getBattle()->battleCanAttack(stack, hoveredStack, hoveredHex) && isTileAttackable(hoveredHex))
{
BattleHex attackFromHex = fromWhichHexAttack(hoveredHex);
if(owner.getBattle()->battleCanAttack(stack, hoveredStack, attackFromHex))
{
if(stack->doubleWide())
return {attackFromHex, stack->occupiedHex(attackFromHex)};
else
return {attackFromHex};
return {attackFromHex};
}
}