Fix crash from diplomacy screen.

This commit is contained in:
Duan Tao 2019-05-10 18:33:12 +08:00 committed by Yair Morgenstern
parent c37983667c
commit 91baeddde2
2 changed files with 5 additions and 3 deletions

View File

@ -327,9 +327,11 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
}
for(civ in relevantCivs.filter { playerKnows(it) && !it.isDefeated() })
for(diplomacy in civ.diplomacy.values.filter { !it.otherCiv().isBarbarianCivilization() && playerKnows(it.otherCiv()) && !it.otherCiv().isDefeated()}){
for(diplomacy in civ.diplomacy.values.
filter { !it.otherCiv().isBarbarianCivilization() && !it.otherCiv().isCityState()
&& playerKnows(it.otherCiv()) && !it.otherCiv().isDefeated()}){
val civGroup = civGroups[civ.civName]!!
val otherCivGroup = civGroups[diplomacy.otherCivName]!!
val otherCivGroup = civGroups[diplomacy.otherCivName]!! //
val statusLine = ImageGetter.getLine(civGroup.x+civGroup.width/2,civGroup.y+civGroup.height/2,
otherCivGroup.x+otherCivGroup.width/2,otherCivGroup.y+otherCivGroup.height/2,3f)

View File

@ -92,7 +92,7 @@ class DiplomacyScreen:CameraStageBaseScreen() {
val diplomacyTable = Table()
diplomacyTable.defaults().pad(10f)
if (otherCiv.isCityState()) {
diplomacyTable.add(otherCiv.getNation().getLeaderDisplayName().toLabel())
diplomacyTable.add(otherCiv.getNation().getLeaderDisplayName().toLabel()).row()
diplomacyTable.add(("Type : " + otherCiv.getCityStateType().toString()).toLabel()).row()
diplomacyTable.add(("Influence : " + otherCiv.getDiplomacyManager(currentPlayerCiv).influence.toInt().toString()).toLabel()).row()
if (otherCiv.getDiplomacyManager(currentPlayerCiv).influence >= 60) {