From 13c4a3ff8b71b4e7c3bed5d1f77c487d29a44bb8 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 10 Nov 2025 12:27:02 +0100 Subject: [PATCH] Sort fights by start time in descending order and refactor `saveFromStream` method to use `useDb` block. Signed-off-by: Chaoscaot --- CommonCore/SQL/src/de/steamwar/sql/Fight.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/Fight.kt b/CommonCore/SQL/src/de/steamwar/sql/Fight.kt index 72c14d77..7d609d09 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/Fight.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/Fight.kt @@ -122,7 +122,7 @@ class Fight(id: EntityID) : IntEntity(id) { replayExists() && useDb { exec( "SELECT (b.NodeId IS NULL OR b.Config & 2) AND (r.NodeId IS NULL OR r.Config & 2) AS ReplayAllowed FROM Fight f LEFT OUTER JOIN SchematicNode b ON f.BlueSchem = b.NodeId LEFT OUTER JOIN SchematicNode r ON f.RedSchem = r.NodeId WHERE FightId = ?", - args = listOf(IntegerColumnType() to this@Fight.id) + args = listOf(IntegerColumnType() to this@Fight.id.value) ) { if (it.next()) { it.getBoolean("ReplayAllowed")