From 12c468eb339f402569d0af9ebc532fb3bcc8477c Mon Sep 17 00:00:00 2001 From: thorwin99 Date: Tue, 2 May 2023 08:54:31 +0200 Subject: [PATCH] Fix for issue #152. Planets are now also checked if they already exist as moons --- SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs b/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs index 870123d..32f4a59 100644 --- a/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs +++ b/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs @@ -837,6 +837,16 @@ public override void UpdateBeforeSimulation() } } } + foreach (var obj in StarSystem.GetAllByType(MySystemObjectType.MOON)) + { + if (obj is MySystemPlanetMoon) + { + if ((obj as MySystemPlanetMoon).EntityId == p.EntityId) + { + exists = true; + } + } + } if (!exists && StarSystem.CenterObject != null) { MySystemPlanet vanillaPlanet = new MySystemPlanet();