mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Stop Exploration sets unit.action to null (#1613)
* Stop Exploration sets unit.action to null * UnitActions callback Fix #1614
This commit is contained in:
parent
2af847b3a6
commit
23cfab6001
@ -25,7 +25,11 @@ class UnitActions {
|
|||||||
val actionList = ArrayList<UnitAction>()
|
val actionList = ArrayList<UnitAction>()
|
||||||
|
|
||||||
if (unit.action != null && unit.action!!.startsWith("moveTo")) {
|
if (unit.action != null && unit.action!!.startsWith("moveTo")) {
|
||||||
actionList += UnitAction(name = "Stop movement", canAct = true)
|
actionList += UnitAction(
|
||||||
|
name = "Stop movement",
|
||||||
|
canAct = true,
|
||||||
|
action = { unit.action = null }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val workingOnImprovement = unit.hasUnique("Can build improvements on tiles") && unit.currentTile.hasImprovementInProgress()
|
val workingOnImprovement = unit.hasUnique("Can build improvements on tiles") && unit.currentTile.hasImprovementInProgress()
|
||||||
@ -70,7 +74,11 @@ class UnitActions {
|
|||||||
unit.action = Constants.unitActionExplore
|
unit.action = Constants.unitActionExplore
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
actionList += UnitAction(name = "Stop exploration", canAct = true)
|
actionList += UnitAction(
|
||||||
|
name = "Stop exploration",
|
||||||
|
canAct = true,
|
||||||
|
action = { unit.action = null }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +175,11 @@ class UnitActions {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (Constants.unitActionAutomation == unit.action) {
|
if (Constants.unitActionAutomation == unit.action) {
|
||||||
actionList += UnitAction(name = "Stop automation", canAct = true)
|
actionList += UnitAction(
|
||||||
|
name = "Stop automation",
|
||||||
|
canAct = true,
|
||||||
|
action = { unit.action = null }
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
actionList += UnitAction(
|
actionList += UnitAction(
|
||||||
name = "Automate",
|
name = "Automate",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user