mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-13 00:04:38 +07:00
Fix crash when exploring (#7314)
* Exploring units now take several turns to reach a ruin (but only if it is in vision, not behind fog of war) Re-did this because the last pull request was a mess and so was everything else I was doing * Fix crash reported by @Aditya von Karma#8015 on discord * Update UnitAutomation.kt Use canReach instead of canMoveTo * Update UnitAutomation.kt Use both canReach and canMoveTo
This commit is contained in:
parent
8f0e64e02d
commit
27854bc031
@ -55,7 +55,7 @@ object UnitAutomation {
|
||||
(it.improvement != null && it.getTileImprovement()!!.isAncientRuinsEquivalent())
|
||||
|| it.improvement == Constants.barbarianEncampment
|
||||
)
|
||||
&& unit.movement.canMoveTo(it)
|
||||
&& unit.movement.canMoveTo(it) && unit.movement.canReach(it)
|
||||
} ?: return false
|
||||
unit.movement.headTowards(tileWithRuinOrEncampment)
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user