Fix of the click on unknown civilization (#1989)

* Fix of the click on unknown civilization

* Minor optimization

* Better naming of variable
This commit is contained in:
JackRainy 2020-02-22 23:10:52 +02:00 committed by GitHub
parent 13d50f250c
commit eb0fd17d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,13 +70,14 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
// clicking swings the button a little down to allow selection of units there.
// this also allows to target selected units to move to the city tile from elsewhere.
if (isButtonMoved) {
val viewingCiv = UncivGame.Current.worldScreen.viewingCiv
// second tap on the button will go to the city screen
// if this city belongs to you
if (UncivGame.Current.viewEntireMapForDebug || belongsToViewingCiv()) {
UncivGame.Current.setScreen(CityScreen(city))
} else {
} else if (viewingCiv.knows(city.civInfo)) {
// If city doesn't belong to you, go directly to its owner's diplomacy screen.
val screen = DiplomacyScreen(UncivGame.Current.worldScreen.viewingCiv)
val screen = DiplomacyScreen(viewingCiv)
screen.updateRightSide(city.civInfo)
UncivGame.Current.setScreen(screen)
}