mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Fixed bug in inquisitor automation
This commit is contained in:
parent
f90b22ad60
commit
bd70500685
@ -301,12 +301,9 @@ object SpecificUnitAutomation {
|
||||
.filterNot { unit.getTile().owningCity == it.owningCity } // to prevent the ai from moving around randomly
|
||||
.filter { unit.movement.canMoveTo(it) }
|
||||
.sortedBy { it.aerialDistanceTo(unit.currentTile) }
|
||||
.firstOrNull { unit.movement.canReach(it) }
|
||||
.firstOrNull { unit.movement.canReach(it) } ?: return
|
||||
|
||||
|
||||
if (destination != null) {
|
||||
unit.movement.headTowards(destination)
|
||||
}
|
||||
|
||||
if (unit.currentTile.owningCity?.religion?.getMajorityReligion()?.name != unit.religion)
|
||||
doReligiousAction(unit, unit.getTile())
|
||||
@ -341,7 +338,8 @@ object SpecificUnitAutomation {
|
||||
.firstOrNull { unit.movement.canReach(it) }
|
||||
}
|
||||
|
||||
if (destination != null)
|
||||
if (destination == null) return
|
||||
|
||||
unit.movement.headTowards(destination)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user