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:
Skekdog 2022-06-27 13:51:46 +01:00 committed by GitHub
parent 8f0e64e02d
commit 27854bc031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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