Do not display "war against" quest to the civ that the war is against

Do not allow liberating city-states you were at war with
This commit is contained in:
Yair Morgenstern 2023-01-09 19:27:53 +02:00
parent c4364e3a8f
commit 69d4772f0d
3 changed files with 9 additions and 7 deletions

View File

@ -193,7 +193,7 @@ class CityInfoConquestFunctions(val city: CityInfo){
return
}
val foundingCiv = civInfo.gameInfo.civilizations.first { it.civName == foundingCiv }
val foundingCiv = civInfo.gameInfo.getCivilization(foundingCiv)
if (foundingCiv.isDefeated()) // resurrected civ
for (diploManager in foundingCiv.diplomacy.values)
if (diploManager.diplomaticStatus == DiplomaticStatus.War)

View File

@ -343,7 +343,7 @@ class DiplomacyScreen(
diplomacyTable.add(getQuestTable(assignedQuest)).row()
}
for (target in otherCiv.getKnownCivs().filter { otherCiv.questManager.warWithMajorActive(it) }) {
for (target in otherCiv.getKnownCivs().filter { otherCiv.questManager.warWithMajorActive(it) && viewingCiv != it }) {
diplomacyTable.addSeparator()
diplomacyTable.add(getWarWithMajorTable(target, otherCiv)).row()
}

View File

@ -153,12 +153,14 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
addQuestionAboutTheCity(city.name)
val conqueringCiv = worldScreen.gameInfo.getCurrentPlayerCivilization()
addLiberateOption(city.foundingCiv) {
city.liberateCity(conqueringCiv)
worldScreen.shouldUpdate = true
close()
if (!conqueringCiv.isAtWarWith(worldScreen.gameInfo.getCivilization(city.foundingCiv))) {
addLiberateOption(city.foundingCiv) {
city.liberateCity(conqueringCiv)
worldScreen.shouldUpdate = true
close()
}
addSeparator()
}
addSeparator()
add(getCloseButton("Keep it")).row()
}
AlertType.BorderConflict -> {