Skip to content

Commit

Permalink
Fixed isGoodTileToExplore() to check if there is no enemy in range (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tuvus authored Nov 26, 2023
1 parent 09fdd8b commit 10b3d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/com/unciv/logic/automation/unit/UnitAutomation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 10b3d69

Please sign in to comment.