mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-07 17:43:54 +07:00
Resolved #1963 - can now unautomate embarked workers
This commit is contained in:
parent
7a96a96d73
commit
65e1c90e28
@ -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'
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user