From 64b8d805c3124ffd1da6dc1cc367c8559d7a2946 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 20 Feb 2022 12:45:48 +0200 Subject: [PATCH] Resolved #6184 - don't display turns to relationship change for non-decreasing city-state relationships --- .../unciv/logic/civilization/diplomacy/DiplomacyManager.kt | 1 + core/src/com/unciv/ui/trade/DiplomacyScreen.kt | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt index 0879307a95..7178864933 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt @@ -200,6 +200,7 @@ class DiplomacyManager() { if (civInfo.isCityState() && !otherCiv().isCityState()) { val dropPerTurn = getCityStateInfluenceDegrade() return when { + dropPerTurn == 0f -> 0 relationshipLevel() >= RelationshipLevel.Ally -> ceil((influence - 60f) / dropPerTurn).toInt() + 1 relationshipLevel() >= RelationshipLevel.Friend -> ceil((influence - 30f) / dropPerTurn).toInt() + 1 else -> 0 diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index cd818b5350..742270d27d 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -210,8 +210,9 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo): BaseScreen() { if (relationLevel >= RelationshipLevel.Friend) { // RelationshipChange = Ally -> Friend or Friend -> Favorable val turnsToRelationshipChange = otherCivDiplomacyManager.getTurnsToRelationshipChange() - diplomacyTable.add("Relationship changes in another [$turnsToRelationshipChange] turns".toLabel()) - .row() + if (turnsToRelationshipChange != 0) + diplomacyTable.add("Relationship changes in another [$turnsToRelationshipChange] turns".toLabel()) + .row() } val friendBonusLabelColor = if (relationLevel >= RelationshipLevel.Friend) Color.GREEN else Color.GRAY