mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Fixed a few bugs relating to earning great prophets (#5267)
* Fixed bug where great prophets gifted by city-states wouldn't have a religion * Fixed bug where earning/buying great prophets whithout having founded a religion would result in great prophets of your pantheon, regardless of the religious state of the city
This commit is contained in:
parent
027057874d
commit
cb4feb29ed
@ -77,8 +77,8 @@ class CityStateFunctions(val civInfo: CivilizationInfo) {
|
|||||||
return
|
return
|
||||||
val giftedUnit = giftableUnits.random()
|
val giftedUnit = giftableUnits.random()
|
||||||
val cities = NextTurnAutomation.getClosestCities(receivingCiv, civInfo)
|
val cities = NextTurnAutomation.getClosestCities(receivingCiv, civInfo)
|
||||||
val placedUnit = receivingCiv.placeUnitNearTile(cities.city1.location, giftedUnit.name)
|
val placedUnit = receivingCiv.addUnit(giftedUnit.name, cities.city1)
|
||||||
if (placedUnit == null) return
|
?: return
|
||||||
val locations = LocationAction(listOf(placedUnit.getTile().position, cities.city2.location))
|
val locations = LocationAction(listOf(placedUnit.getTile().position, cities.city2.location))
|
||||||
receivingCiv.addNotification( "[${civInfo.civName}] gave us a [${giftedUnit.name}] as a gift!", locations, civInfo.civName, giftedUnit.name)
|
receivingCiv.addNotification( "[${civInfo.civName}] gave us a [${giftedUnit.name}] as a gift!", locations, civInfo.civName, giftedUnit.name)
|
||||||
}
|
}
|
||||||
|
@ -921,8 +921,9 @@ class CivilizationInfo {
|
|||||||
if (placedUnit.hasUnique("Religious Unit") && gameInfo.isReligionEnabled()) {
|
if (placedUnit.hasUnique("Religious Unit") && gameInfo.isReligionEnabled()) {
|
||||||
placedUnit.religion =
|
placedUnit.religion =
|
||||||
when {
|
when {
|
||||||
placedUnit.hasUnique("Takes your religion over the one in their birth city") ->
|
placedUnit.hasUnique("Takes your religion over the one in their birth city")
|
||||||
religionManager.religion?.name
|
&& religionManager.religion?.isMajorReligion() == true ->
|
||||||
|
religionManager.religion!!.name
|
||||||
city != null -> city.cityConstructions.cityInfo.religion.getMajorityReligionName()
|
city != null -> city.cityConstructions.cityInfo.religion.getMajorityReligionName()
|
||||||
else -> religionManager.religion?.name
|
else -> religionManager.religion?.name
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user