From 43893bf96df5700eeafb2c60d80bdb12718bb7c2 Mon Sep 17 00:00:00 2001 From: 8vogt <8vogt@informatik.uni-hamburg.de> Date: Sat, 20 Feb 2021 14:50:45 +0100 Subject: [PATCH] Only add persistent gps, when sphere is actually there --- SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs b/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs index 2ca2306..2a80615 100644 --- a/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs +++ b/SEWorldGenPlugin/Generator/MyStarSystemGenerator.cs @@ -187,7 +187,11 @@ private void AddAllPersistentGps() MyAbstractAsteroidObjectProvider provider = null; if (MyAsteroidObjectsManager.Static.AsteroidObjectProviders.TryGetValue(asteroid.AsteroidTypeName, out provider)) { - MyGPSManager.Static.AddPersistentGps(item.DisplayName, RING_GPS_COLOR, provider.GetAsteroidObjectShape(asteroid).GetPointInShape(), item.Id); + var shape = provider.GetAsteroidObjectShape(asteroid); + + if (shape == null) break; + + MyGPSManager.Static.AddPersistentGps(item.DisplayName, RING_GPS_COLOR, shape.GetPointInShape(), item.Id); } } break;