3.9.17-patch2

This commit is contained in:
Yair Morgenstern 2020-08-03 23:30:02 +03:00
parent ebb8432dcb
commit 697ff92fea
2 changed files with 7 additions and 6 deletions

View file

@ -3,8 +3,8 @@ package com.unciv.build
object BuildConfig { object BuildConfig {
const val kotlinVersion = "1.3.71" const val kotlinVersion = "1.3.71"
const val appName = "Unciv" const val appName = "Unciv"
const val appCodeNumber = 455 const val appCodeNumber = 456
const val appVersion = "3.9.17-patch1" const val appVersion = "3.9.17-patch2"
const val gdxVersion = "1.9.10" const val gdxVersion = "1.9.10"
const val roboVMVersion = "2.3.1" const val roboVMVersion = "2.3.1"

View file

@ -174,13 +174,14 @@ object UnitActions {
private fun addPillageAction(unit: MapUnit, actionList: ArrayList<UnitAction>, worldScreen: WorldScreen) { private fun addPillageAction(unit: MapUnit, actionList: ArrayList<UnitAction>, worldScreen: WorldScreen) {
val pillageAction = getPillageAction(unit) val pillageAction = getPillageAction(unit)
if (pillageAction == null) return if (pillageAction == null) return
val pillageWithConfirmationAction = UnitAction(type = UnitActionType.Pillage, action = { if(pillageAction.action==null)
actionList += UnitAction(UnitActionType.Pillage, action = null)
else actionList += UnitAction(type = UnitActionType.Pillage) {
if (!worldScreen.hasOpenPopups()) { if (!worldScreen.hasOpenPopups()) {
val pillageText = "Are you sure you want to pillage this [${unit.currentTile.improvement}]?" val pillageText = "Are you sure you want to pillage this [${unit.currentTile.improvement}]?"
YesNoPopup(pillageText, { pillageAction.action!!(); worldScreen.shouldUpdate = true }).open() YesNoPopup(pillageText, { (pillageAction.action)(); worldScreen.shouldUpdate = true }).open()
} }
}) }
actionList += pillageWithConfirmationAction
} }
fun getPillageAction(unit: MapUnit): UnitAction? { fun getPillageAction(unit: MapUnit): UnitAction? {