Browse Source

Merge pull request #6383 from mrhaandi/highlight-shootable

Highlight shootable hexes
Ivan Savenko 2 weeks ago
parent
commit
ee2164f6dd
1 changed files with 3 additions and 1 deletions
  1. 3 1
      client/battle/BattleFieldController.cpp

+ 3 - 1
client/battle/BattleFieldController.cpp

@@ -283,7 +283,9 @@ void BattleFieldController::redrawBackgroundWithHexes()
 			//shade occupiable and attackable hexes
 			//shade occupiable and attackable hexes
 			if (occupiableHexes.contains(hex) ||
 			if (occupiableHexes.contains(hex) ||
 				(owner.getBattle()->battleCanAttackUnit(activeStack, owner.getBattle()->battleGetStackByPos(hex, true)) &&
 				(owner.getBattle()->battleCanAttackUnit(activeStack, owner.getBattle()->battleGetStackByPos(hex, true)) &&
-					owner.getBattle()->battleCanAttackHex(availableHexes, activeStack, hex)))
+					owner.getBattle()->battleCanAttackHex(availableHexes, activeStack, hex)) ||
+				(owner.getBattle()->battleGetStackByPos(hex, true) &&
+					owner.getBattle()->battleCanShoot(activeStack, hex)))
 				showHighlightedHex(*backgroundWithHexes, cellShade, hex, false);
 				showHighlightedHex(*backgroundWithHexes, cellShade, hex, false);
 		}
 		}
 	}
 	}