mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Resolved #5265 - cannot add 2 of the same buildings to the queue visually
This commit is contained in:
parent
73f275f4cd
commit
1a7f562bc0
@ -601,10 +601,13 @@ class CityConstructions {
|
||||
|
||||
fun addToQueue(constructionName: String) {
|
||||
if (isQueueFull()) return
|
||||
val construction = getConstruction(constructionName)
|
||||
if (!construction.isBuildable(this)) return
|
||||
if (construction is Building && isBeingConstructedOrEnqueued(constructionName)) return
|
||||
if (currentConstructionFromQueue == "" || currentConstructionFromQueue == "Nothing") {
|
||||
currentConstructionFromQueue = constructionName
|
||||
} else if (getConstruction(constructionQueue.last()) is PerpetualConstruction) {
|
||||
if (getConstruction(constructionName) is PerpetualConstruction) { // perpetual constructions will replace each other
|
||||
if (construction is PerpetualConstruction) { // perpetual constructions will replace each other
|
||||
constructionQueue.removeAt(constructionQueue.size - 1)
|
||||
constructionQueue.add(constructionName)
|
||||
} else
|
||||
|
@ -343,10 +343,10 @@ class CivilizationInfo {
|
||||
fun hasResource(resourceName: String): Boolean = getCivResourcesByName()[resourceName]!! > 0
|
||||
|
||||
// This function should be removed and replaced by marking where uniques originate from, hopefully.
|
||||
fun getCivWideBuildingUniques(cityItIsFor: CityInfo?): Sequence<Unique> =
|
||||
fun getCivWideBuildingUniques(cityItIsFor: CityInfo): Sequence<Unique> =
|
||||
cities.asSequence().flatMap {
|
||||
city ->
|
||||
if (cityItIsFor != null && city == cityItIsFor)
|
||||
if (city == cityItIsFor)
|
||||
city.getAllUniquesWithNonLocalEffects().filter { !it.isAntiLocalEffect }
|
||||
else city.getAllUniquesWithNonLocalEffects()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user