diff --git a/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt b/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt index cd774d3c..5daa1128 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt @@ -48,14 +48,17 @@ class InternalKit(id: EntityID): CompositeEntity(id) { companion object: CompositeEntityClass(PersonalKitTable) { @JvmStatic fun get(userId: Int, gamemode: String) = useDb { - find { PersonalKitTable.userId eq userId and (PersonalKitTable.gamemode eq gamemode) and (PersonalKitTable.inUse eq true) } + find { PersonalKitTable.userId eq userId and (PersonalKitTable.gamemode eq gamemode) } .toList() } @JvmStatic fun get(userId: Int, gamemode: String, kitName: String) = useDb { - find { PersonalKitTable.userId eq userId and (PersonalKitTable.gamemode eq gamemode) and (PersonalKitTable.kitName eq kitName) and (PersonalKitTable.inUse eq true) } - .firstOrNull() + get(CompositeID { + it[PersonalKitTable.userId] = EntityID(userId, SteamwarUserTable) + it[PersonalKitTable.gamemode] = gamemode + it[PersonalKitTable.kitName] = kitName + }) } @JvmStatic