Merge pull request #344 from ninjatao/can_only_attack_water

Make submarine only attack water tiles.
This commit is contained in:
yairm210 2018-12-13 13:15:40 +02:00 committed by GitHub
commit 042e295611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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