Prevent overriding default group

This commit is contained in:
fgerber 2024-04-08 10:52:08 +02:00
parent bafd3cea14
commit 01dab6aa30

View File

@ -34,7 +34,7 @@ class Groups(val id: Int, private val grps: HashMap<Int, Group>) {
fun genKey(): Int { fun genKey(): Int {
val key = rnd.nextInt() val key = rnd.nextInt()
if (grps.containsKey(key) || key in listOf(NO_GROUP, AUTO_GROUP)) return genKey() if (grps.containsKey(key) || key in listOf(NO_GROUP, DEFAULT_GROUP, AUTO_GROUP)) return genKey()
return key return key
} }