mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Fixed bug where great prophets could be given when religion was disabled (#4502)
This commit is contained in:
parent
f54c76ec42
commit
68b40cf860
@ -778,7 +778,9 @@ class CivilizationInfo {
|
||||
/** Gain a random great person from a random city state */
|
||||
private fun gainGreatPersonFromCityState() {
|
||||
val givingCityState = getKnownCivs().filter { it.isCityState() && it.getAllyCiv() == civName}.random()
|
||||
val giftedUnit = gameInfo.ruleSet.units.values.filter { it.isGreatPerson() }.random()
|
||||
var giftableUnits = gameInfo.ruleSet.units.values.filter { it.isGreatPerson() }
|
||||
if (!gameInfo.hasReligionEnabled()) giftableUnits = giftableUnits.filterNot { it.uniques.contains("Great Person - [Faith]")}
|
||||
val giftedUnit = giftableUnits.random()
|
||||
val cities = NextTurnAutomation.getClosestCities(this, givingCityState)
|
||||
val placedUnit = placeUnitNearTile(cities.city1.location, giftedUnit.name)
|
||||
if (placedUnit == null) return
|
||||
|
Loading…
x
Reference in New Issue
Block a user