mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-20 19:56:51 +01: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 {
|
fun raisePriority(constructionQueueIndex: Int): Int {
|
||||||
|
if (constructionQueueIndex == 0) return constructionQueueIndex // Already first
|
||||||
constructionQueue.swap(constructionQueueIndex - 1, constructionQueueIndex)
|
constructionQueue.swap(constructionQueueIndex - 1, constructionQueueIndex)
|
||||||
return constructionQueueIndex - 1
|
return constructionQueueIndex - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lowering == Highering next element in queue
|
// Lowering == Highering next element in queue
|
||||||
fun lowerPriority(constructionQueueIndex: Int): Int {
|
fun lowerPriority(constructionQueueIndex: Int): Int {
|
||||||
|
if (constructionQueueIndex >= constructionQueue.size - 1) return constructionQueueIndex // Already last
|
||||||
raisePriority(constructionQueueIndex + 1)
|
raisePriority(constructionQueueIndex + 1)
|
||||||
return constructionQueueIndex + 1
|
return constructionQueueIndex + 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user