Fixed a bug where AI would not found religions (#5544)

This commit is contained in:
Xander Lenstra 2021-10-24 19:44:54 +02:00 committed by GitHub
parent 074676c342
commit e9d36ea0ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -378,7 +378,9 @@ object SpecificUnitAutomation {
} }
fun foundReligion(unit: MapUnit) { fun foundReligion(unit: MapUnit) {
val cityToFoundReligionAt = unit.civInfo.cities.firstOrNull { val cityToFoundReligionAt =
if (unit.getTile().isCityCenter() && !unit.getTile().owningCity!!.isHolyCity()) unit.getTile().owningCity
else unit.civInfo.cities.firstOrNull {
!it.isHolyCity() !it.isHolyCity()
&& unit.movement.canMoveTo(it.getCenterTile()) && unit.movement.canMoveTo(it.getCenterTile())
&& unit.movement.canReach(it.getCenterTile()) && unit.movement.canReach(it.getCenterTile())