Fix findRandomWorld not accounting for satellites
This commit is contained in:
parent
cb384be77a
commit
aea534add4
@ -152,7 +152,15 @@ class ServerUniverse private constructor(marker: Nothing?) : Universe(), Closeab
|
|||||||
val y = random.nextRange(baseInformation.xyCoordRange)
|
val y = random.nextRange(baseInformation.xyCoordRange)
|
||||||
|
|
||||||
val result = scanSystems<UniversePos>(rect + Vector2i(x, y)) {
|
val result = scanSystems<UniversePos>(rect + Vector2i(x, y)) {
|
||||||
val children = children(it)
|
val children = ArrayList<UniversePos>()
|
||||||
|
|
||||||
|
for (planet in children(it)) {
|
||||||
|
children.add(planet)
|
||||||
|
|
||||||
|
for (satellite in children(planet)) {
|
||||||
|
children.add(satellite)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (children.isEmpty())
|
if (children.isEmpty())
|
||||||
return@scanSystems KOptional()
|
return@scanSystems KOptional()
|
||||||
|
Loading…
Reference in New Issue
Block a user