mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix NRE in ShipLogHandler.cs
This commit is contained in:
parent
5414ea2d41
commit
cd7086f669
@ -26,9 +26,18 @@ namespace NewHorizons.Handlers
|
|||||||
_entryIDsToNHBody = new Dictionary<string, NewHorizonsBody>();
|
_entryIDsToNHBody = new Dictionary<string, NewHorizonsBody>();
|
||||||
_nhBodyToAstroIDs = new Dictionary<NewHorizonsBody, string>();
|
_nhBodyToAstroIDs = new Dictionary<NewHorizonsBody, string>();
|
||||||
|
|
||||||
List<GameObject> gameObjects = SearchUtilities.GetAllChildren(SearchUtilities.Find(PAN_ROOT_PATH));
|
GameObject panRoot = SearchUtilities.Find(PAN_ROOT_PATH);
|
||||||
_vanillaBodies = gameObjects.ConvertAll(g => g.name).ToArray();
|
if (panRoot != null)
|
||||||
_vanillaBodyIDs = gameObjects.ConvertAll(g => g.GetComponent<ShipLogAstroObject>()?.GetID()).ToArray();
|
{
|
||||||
|
List<GameObject> gameObjects = SearchUtilities.GetAllChildren(panRoot);
|
||||||
|
_vanillaBodies = gameObjects.ConvertAll(g => g.name).ToArray();
|
||||||
|
_vanillaBodyIDs = gameObjects.ConvertAll(g => g.GetComponent<ShipLogAstroObject>()?.GetID()).ToArray();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_vanillaBodies = new string[0];
|
||||||
|
_vanillaBodyIDs = new string[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CheckForModdedFacts(ShipLogManager manager)
|
public static void CheckForModdedFacts(ShipLogManager manager)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user