mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -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
|
.filterNot { unit.getTile().owningCity == it.owningCity } // to prevent the ai from moving around randomly
|
||||||
.filter { unit.movement.canMoveTo(it) }
|
.filter { unit.movement.canMoveTo(it) }
|
||||||
.sortedBy { it.aerialDistanceTo(unit.currentTile) }
|
.sortedBy { it.aerialDistanceTo(unit.currentTile) }
|
||||||
.firstOrNull { unit.movement.canReach(it) }
|
.firstOrNull { unit.movement.canReach(it) } ?: return
|
||||||
|
|
||||||
|
|
||||||
if (destination != null) {
|
|
||||||
unit.movement.headTowards(destination)
|
unit.movement.headTowards(destination)
|
||||||
}
|
|
||||||
|
|
||||||
if (unit.currentTile.owningCity?.religion?.getMajorityReligion()?.name != unit.religion)
|
if (unit.currentTile.owningCity?.religion?.getMajorityReligion()?.name != unit.religion)
|
||||||
doReligiousAction(unit, unit.getTile())
|
doReligiousAction(unit, unit.getTile())
|
||||||
@ -341,7 +338,8 @@ object SpecificUnitAutomation {
|
|||||||
.firstOrNull { unit.movement.canReach(it) }
|
.firstOrNull { unit.movement.canReach(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destination != null)
|
if (destination == null) return
|
||||||
|
|
||||||
unit.movement.headTowards(destination)
|
unit.movement.headTowards(destination)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user