From aea534add45732857fbda2b35bb188b02a6b755c Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 4 Apr 2024 10:59:17 +0700 Subject: [PATCH] Fix findRandomWorld not accounting for satellites --- .../kstarbound/server/world/ServerUniverse.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerUniverse.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerUniverse.kt index 2cbb0457..78cad64b 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerUniverse.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerUniverse.kt @@ -152,7 +152,15 @@ class ServerUniverse private constructor(marker: Nothing?) : Universe(), Closeab val y = random.nextRange(baseInformation.xyCoordRange) val result = scanSystems(rect + Vector2i(x, y)) { - val children = children(it) + val children = ArrayList() + + for (planet in children(it)) { + children.add(planet) + + for (satellite in children(planet)) { + children.add(satellite) + } + } if (children.isEmpty()) return@scanSystems KOptional()