mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Can now choose construction to work on even when worker has no movement points, since it won't advance unless he does
This commit is contained in:
parent
98685ad7c0
commit
d0a59889c4
@ -277,9 +277,9 @@ object UnitActions {
|
|||||||
|
|
||||||
if (unit.isEmbarked()) return
|
if (unit.isEmbarked()) return
|
||||||
|
|
||||||
val canConstruct =unit.currentMovement > 0
|
val canConstruct = !tile.isCityCenter()
|
||||||
&& !tile.isCityCenter()
|
&& unit.civInfo.gameInfo.ruleSet.tileImprovements.values
|
||||||
&& unit.civInfo.gameInfo.ruleSet.tileImprovements.values.any { tile.canBuildImprovement(it, unit.civInfo) }
|
.any { tile.canBuildImprovement(it, unit.civInfo) }
|
||||||
actionList += UnitAction(
|
actionList += UnitAction(
|
||||||
type = UnitActionType.ConstructImprovement,
|
type = UnitActionType.ConstructImprovement,
|
||||||
isCurrentAction = unit.currentTile.hasImprovementInProgress(),
|
isCurrentAction = unit.currentTile.hasImprovementInProgress(),
|
||||||
@ -379,12 +379,14 @@ object UnitActions {
|
|||||||
}
|
}
|
||||||
addGoldPerGreatPersonUsage(unit.civInfo)
|
addGoldPerGreatPersonUsage(unit.civInfo)
|
||||||
unit.destroy()
|
unit.destroy()
|
||||||
}.takeIf { unit.currentMovement > 0f && !tile.isWater &&
|
}.takeIf {
|
||||||
|
unit.currentMovement > 0f && !tile.isWater &&
|
||||||
!tile.isCityCenter() && !tile.isImpassible() &&
|
!tile.isCityCenter() && !tile.isImpassible() &&
|
||||||
tile.improvement != improvementName &&
|
tile.improvement != improvementName &&
|
||||||
// citadel can be built only next to or within own borders
|
// citadel can be built only next to or within own borders
|
||||||
(improvementName != Constants.citadel ||
|
(improvementName != Constants.citadel ||
|
||||||
tile.neighbors.any { it.getOwner() == unit.civInfo })})
|
tile.neighbors.any { it.getOwner() == unit.civInfo })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return finalActions
|
return finalActions
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user