cover more cases

This commit is contained in:
SimonCeder 2022-07-22 20:14:08 +02:00 committed by GitHub
parent 73ad76b59c
commit 5846da6f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,14 +305,12 @@ class CityStateFunctions(val civInfo: CivilizationInfo) {
for (unit in civInfo.getCivUnits()) for (unit in civInfo.getCivUnits())
unit.gift(otherCiv) unit.gift(otherCiv)
// We want to get rid of the original capital flag for this city state so it can't be liberated in the future. // Make sure this CS can never be liberated
// We do this step to be extra certain to find the correct one since a CS can rarely capture and lose cities civInfo.gameInfo.getCities().filter {
val originalCapital = civInfo.gameInfo.getCities().firstOrNull { it.foundingCiv == civInfo.civName
it.isOriginalCapital && it.foundingCiv == civInfo.civName }.forEach {
} it.foundingCiv = ""
if (originalCapital != null) { it.isOriginalCapital = false
originalCapital.foundingCiv = ""
originalCapital.isOriginalCapital = false
} }
for (city in civInfo.cities) { for (city in civInfo.cities) {