mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
Fix Citadel not quite buildable where it should be (#3788)
This commit is contained in:
@ -183,7 +183,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Citadel",
|
||||
"uniques": ["Gives a defensive bonus of [100]%", "Deal 30 damage to adjacent enemy units", "Great Improvement"]
|
||||
"uniques": ["Gives a defensive bonus of [100]%", "Deal 30 damage to adjacent enemy units", "Great Improvement", "Can be built just outside your borders"]
|
||||
},
|
||||
|
||||
//Civilization unique improvements
|
||||
|
@ -323,7 +323,11 @@ open class TileInfo {
|
||||
return when {
|
||||
improvement.uniqueTo != null && improvement.uniqueTo != civInfo.civName -> false
|
||||
improvement.techRequired != null && !civInfo.tech.isResearched(improvement.techRequired!!) -> false
|
||||
getOwner() != civInfo && !improvement.hasUnique("Can be built outside your borders") -> false
|
||||
getOwner() != civInfo && ! (
|
||||
improvement.hasUnique("Can be built outside your borders")
|
||||
// citadel can be built only next to or within own borders
|
||||
|| improvement.hasUnique("Can be built just outside your borders") && neighbors.any { it.getOwner() == civInfo }
|
||||
) -> false
|
||||
improvement.uniqueObjects.any {
|
||||
it.placeholderText == "Obsolete with []" && civInfo.tech.isResearched(it.params[0])
|
||||
} -> return false
|
||||
|
@ -352,10 +352,7 @@ object UnitActions {
|
||||
unit.destroy()
|
||||
}.takeIf {
|
||||
unit.currentMovement > 0f && tile.canBuildImprovement(improvement, unit.civInfo)
|
||||
&& !tile.isImpassible() && // Not 100% sure that this check is necessary...
|
||||
// citadel can be built only next to or within own borders
|
||||
(improvementName != Constants.citadel ||
|
||||
tile.neighbors.any { it.getOwner() == unit.civInfo })
|
||||
&& !tile.isImpassible() // Not 100% sure that this check is necessary...
|
||||
})
|
||||
}
|
||||
return finalActions
|
||||
|
Reference in New Issue
Block a user