mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 17:32:57 +07:00
Merge pull request #344 from ninjatao/can_only_attack_water
Make submarine only attack water tiles.
This commit is contained in:
commit
042e295611
@ -114,6 +114,7 @@ class UnitAutomation{
|
||||
if(unit.type.isRanged()) return false
|
||||
if(tile.isWater()) return false // can't attack water units while embarked, only land
|
||||
}
|
||||
if (unit.hasUnique("Can only attack water") && tile.isLand()) return false
|
||||
val tileCombatant = Battle(unit.civInfo.gameInfo).getMapCombatantOfTile(tile)
|
||||
if(tileCombatant==null) return false
|
||||
if(tileCombatant.getCivilization()==unit.civInfo ) return false
|
||||
|
Loading…
Reference in New Issue
Block a user