mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 11:34:54 -04:00
Resolved #12753 - Queue items remain in bounds
This commit is contained in:
parent
e16ac94d51
commit
abea819a7f
@ -861,12 +861,14 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
}
|
||||
|
||||
fun raisePriority(constructionQueueIndex: Int): Int {
|
||||
if (constructionQueueIndex == 0) return constructionQueueIndex // Already first
|
||||
constructionQueue.swap(constructionQueueIndex - 1, constructionQueueIndex)
|
||||
return constructionQueueIndex - 1
|
||||
}
|
||||
|
||||
// Lowering == Highering next element in queue
|
||||
fun lowerPriority(constructionQueueIndex: Int): Int {
|
||||
if (constructionQueueIndex >= constructionQueue.size - 1) return constructionQueueIndex // Already last
|
||||
raisePriority(constructionQueueIndex + 1)
|
||||
return constructionQueueIndex + 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user