Resolved #1963 - can now unautomate embarked workers

This commit is contained in:
Yair Morgenstern 2020-02-18 17:25:59 +02:00
parent 7a96a96d73
commit 65e1c90e28
2 changed files with 16 additions and 12 deletions

View File

@ -33,8 +33,8 @@ allprojects {
version = '1.0.1'
ext {
appName = "Unciv"
appCodeNumber = 381
appVersion = "3.6.0"
appCodeNumber = 382
appVersion = "3.6.0-patch1"
gdxVersion = '1.9.10'
roboVMVersion = '2.3.1'

View File

@ -222,17 +222,9 @@ class UnitActions {
}
private fun addWorkerActions(unit: MapUnit, actionList: ArrayList<UnitAction>, tile: TileInfo, worldScreen: WorldScreen, unitTable: UnitTable) {
if (!unit.hasUnique("Can build improvements on tiles") || unit.isEmbarked()) return
actionList += UnitAction(
type = UnitActionType.ConstructImprovement,
canAct = unit.currentMovement > 0
&& !tile.isCityCenter()
&& unit.civInfo.gameInfo.ruleSet.tileImprovements.values.any { tile.canBuildImprovement(it, unit.civInfo) },
isCurrentAction = unit.currentTile.hasImprovementInProgress(),
action = {
worldScreen.game.setScreen(ImprovementPickerScreen(tile) { unitTable.selectedUnit = null })
})
if (!unit.hasUnique("Can build improvements on tiles")) return
// Allow automate/unautomate when embarked, but not building improvements - see #1963
if (Constants.unitActionAutomation == unit.action) {
actionList += UnitAction(
type = UnitActionType.StopAutomation,
@ -248,6 +240,18 @@ class UnitActions {
WorkerAutomation(unit).automateWorkerAction()
})
}
if(unit.isEmbarked()) return
actionList += UnitAction(
type = UnitActionType.ConstructImprovement,
canAct = unit.currentMovement > 0
&& !tile.isCityCenter()
&& unit.civInfo.gameInfo.ruleSet.tileImprovements.values.any { tile.canBuildImprovement(it, unit.civInfo) },
isCurrentAction = unit.currentTile.hasImprovementInProgress(),
action = {
worldScreen.game.setScreen(ImprovementPickerScreen(tile) { unitTable.selectedUnit = null })
})
}
private fun addGreatPersonActions(unit: MapUnit, actionList: ArrayList<UnitAction>, tile: TileInfo) {