From 25ee52738d3150b3b77fba5c2ff605f105043b54 Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 24 Feb 2021 23:24:06 +0000 Subject: [PATCH] Use minimum build number when merging master indexes Some master indexes are used across multiple builds. It makes sense to use the minimum build number, much like how we use the minimum timestamp. Signed-off-by: Graham --- .../main/kotlin/org/openrs2/archive/cache/CacheImporter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt index f28c6ba551..3927aa792b 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt @@ -27,6 +27,7 @@ import java.time.OffsetDateTime import java.time.ZoneOffset import javax.inject.Inject import javax.inject.Singleton +import kotlin.math.min @Singleton public class CacheImporter @Inject constructor( @@ -376,8 +377,7 @@ public class CacheImporter @Inject constructor( check(oldGameId == gameId) if (oldBuild != null && build != null) { - check(oldBuild == build) - newBuild = oldBuild + newBuild = min(oldBuild, build) } else if (oldBuild != null) { newBuild = oldBuild } else {