Fixed a crash when marrying a city-state without cities (#7684)

This commit is contained in:
Xander Lenstra
2022-08-20 20:11:25 +02:00
committed by GitHub
parent e78d929b33
commit 089e762f72

View File

@ -284,6 +284,7 @@ class CityStateFunctions(val civInfo: CivilizationInfo) {
fun canBeMarriedBy(otherCiv: CivilizationInfo): Boolean {
return (!civInfo.isDefeated()
&& civInfo.isCityState()
&& civInfo.cities.any()
&& civInfo.getDiplomacyManager(otherCiv).relationshipLevel() == RelationshipLevel.Ally
&& !otherCiv.getDiplomacyManager(civInfo).hasFlag(DiplomacyFlags.MarriageCooldown)
&& otherCiv.getMatchingUniques(UniqueType.CityStateCanBeBoughtForGold).any()