Fixed isGoodTileToExplore() to check if there is no enemy in range (#10586)

This commit is contained in:
Oskar Niesen 2023-11-26 10:24:46 -06:00 committed by GitHub
parent 09fdd8b8e2
commit 10b3d69dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ object UnitAutomation {
&& tile.neighbors.any { !unit.civ.hasExplored(it) }
&& (!unit.civ.isCityState() || tile.neighbors.any { it.getOwner() == unit.civ }) // Don't want city-states exploring far outside their borders
&& unit.getDamageFromTerrain(tile) <= 0 // Don't take unnecessary damage
&& unit.civ.threatManager.getDistanceToClosestEnemyUnit(tile, 3) <= 3 // don't walk in range of enemy units
&& unit.civ.threatManager.getDistanceToClosestEnemyUnit(tile, 3) > 3 // don't walk in range of enemy units
&& unit.movement.canMoveTo(tile) // expensive, evaluate last
&& unit.movement.canReach(tile) // expensive, evaluate last
}