mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Fixed a bug where AI would not found religions (#5544)
This commit is contained in:
parent
074676c342
commit
e9d36ea0ce
@ -378,11 +378,13 @@ object SpecificUnitAutomation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun foundReligion(unit: MapUnit) {
|
fun foundReligion(unit: MapUnit) {
|
||||||
val cityToFoundReligionAt = unit.civInfo.cities.firstOrNull {
|
val cityToFoundReligionAt =
|
||||||
!it.isHolyCity()
|
if (unit.getTile().isCityCenter() && !unit.getTile().owningCity!!.isHolyCity()) unit.getTile().owningCity
|
||||||
&& unit.movement.canMoveTo(it.getCenterTile())
|
else unit.civInfo.cities.firstOrNull {
|
||||||
&& unit.movement.canReach(it.getCenterTile())
|
!it.isHolyCity()
|
||||||
}
|
&& unit.movement.canMoveTo(it.getCenterTile())
|
||||||
|
&& unit.movement.canReach(it.getCenterTile())
|
||||||
|
}
|
||||||
if (cityToFoundReligionAt == null) return
|
if (cityToFoundReligionAt == null) return
|
||||||
if (unit.getTile() != cityToFoundReligionAt.getCenterTile()) {
|
if (unit.getTile() != cityToFoundReligionAt.getCenterTile()) {
|
||||||
unit.movement.headTowards(cityToFoundReligionAt.getCenterTile())
|
unit.movement.headTowards(cityToFoundReligionAt.getCenterTile())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user