forked from SteamWar/SteamWar
@@ -73,8 +73,8 @@ class InternalKit(id: EntityID<CompositeID>): CompositeEntity(id) {
|
||||
this.rawInventory = rawInventory
|
||||
this.rawArmor = rawArmor
|
||||
this.inUse = false
|
||||
}
|
||||
}.also { it.setDefault() }
|
||||
}.also { it.setDefault() }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getKitInUse(userId: Int, gamemode: String) = useDb {
|
||||
@@ -110,6 +110,7 @@ class InternalKit(id: EntityID<CompositeID>): CompositeEntity(id) {
|
||||
|
||||
fun setDefault() = useDb {
|
||||
find { PersonalKitTable.userId eq userID and (PersonalKitTable.gamemode eq gameMode) and (PersonalKitTable.inUse eq true) }
|
||||
.filter { it.id.value != this@InternalKit.id.value }
|
||||
.forEach { it.inUse = false }
|
||||
inUse = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user