Prevent overriding default group
This commit is contained in:
1 parent
bafd3cea14
commit
01dab6aa30
1 file changed
+1
-1
@@ -34,7 +34,7 @@ class Groups(val id: Int, private val grps: HashMap<Int, Group>) {
|
||||
|
||||
fun genKey(): Int {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user