From d47a3e8633fbeca3ef4e733a1238ef38b7a5c6e6 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 7 May 2024 19:05:16 +0200 Subject: Fix wrapping with ordered waypoints --- src/main/kotlin/moe/nea/firmament/features/world/Waypoints.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/moe/nea/firmament/features/world/Waypoints.kt b/src/main/kotlin/moe/nea/firmament/features/world/Waypoints.kt index 5d75731..b41c31a 100644 --- a/src/main/kotlin/moe/nea/firmament/features/world/Waypoints.kt +++ b/src/main/kotlin/moe/nea/firmament/features/world/Waypoints.kt @@ -256,7 +256,7 @@ fun List.wrappingWindow(startIndex: Int, windowSize: Int): List { result.addAll(subList(startIndex, startIndex + windowSize)) } else { result.addAll(subList(startIndex, size)) - result.addAll(subList(0, minOf(size - startIndex - windowSize, startIndex))) + result.addAll(subList(0, minOf(windowSize - (size - startIndex), startIndex))) } return result } -- cgit