mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Exploring units now take several turns to reach a ruin (but only if it is in vision, not behind fog of war) (#7285)
Re-did this because the last pull request was a mess and so was everything else I was doing
This commit is contained in:
parent
efc095eaa1
commit
3e9a485b86
@ -48,8 +48,8 @@ object UnitAutomation {
|
|||||||
|
|
||||||
private fun tryGoToRuinAndEncampment(unit: MapUnit): Boolean {
|
private fun tryGoToRuinAndEncampment(unit: MapUnit): Boolean {
|
||||||
if (!unit.civInfo.isMajorCiv()) return false // barbs don't have anything to do in ruins
|
if (!unit.civInfo.isMajorCiv()) return false // barbs don't have anything to do in ruins
|
||||||
val unitDistanceToTiles = unit.movement.getDistanceToTiles()
|
|
||||||
val tileWithRuinOrEncampment = unitDistanceToTiles.keys
|
val tileWithRuinOrEncampment = unit.viewableTiles
|
||||||
.firstOrNull {
|
.firstOrNull {
|
||||||
(
|
(
|
||||||
(it.improvement != null && it.getTileImprovement()!!.isAncientRuinsEquivalent())
|
(it.improvement != null && it.getTileImprovement()!!.isAncientRuinsEquivalent())
|
||||||
@ -57,7 +57,7 @@ object UnitAutomation {
|
|||||||
)
|
)
|
||||||
&& unit.movement.canMoveTo(it)
|
&& unit.movement.canMoveTo(it)
|
||||||
} ?: return false
|
} ?: return false
|
||||||
unit.movement.moveToTile(tileWithRuinOrEncampment)
|
unit.movement.headTowards(tileWithRuinOrEncampment)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user