mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Also check if the planet is destroyed before trying to make the map mode object
This commit is contained in:
parent
33b95fea83
commit
087e3d691e
@ -50,7 +50,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
|
||||
Material greyScaleMaterial = SearchUtilities.Find(ShipLogHandler.PAN_ROOT_PATH + "/TimberHearth/Sprite").GetComponent<Image>().material;
|
||||
List<NewHorizonsBody> bodies = Main.BodyDict[systemName].Where(
|
||||
b => !(b.Config.ShipLog?.mapMode?.remove ?? false) && !b.Config.isQuantumState
|
||||
b => !(b.Config.ShipLog?.mapMode?.remove ?? false) && !b.Config.isQuantumState && !b.Config.destroy
|
||||
).ToList();
|
||||
bool flagManualPositionUsed = systemName == "SolarSystem";
|
||||
bool flagAutoPositionUsed = false;
|
||||
@ -157,6 +157,12 @@ namespace NewHorizons.Builder.ShipLog
|
||||
|
||||
private static ShipLogAstroObject AddShipLogAstroObject(GameObject gameObject, NewHorizonsBody body, Material greyScaleMaterial, int layer)
|
||||
{
|
||||
if (body.Object == null)
|
||||
{
|
||||
NHLogger.LogError($"Tried to make ship logs for planet with null Object: [{body?.Config?.name}]");
|
||||
return null;
|
||||
}
|
||||
|
||||
const float unviewedIconOffset = 15;
|
||||
|
||||
NHLogger.LogVerbose($"Adding ship log astro object for {body.Config.name}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user