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,10 +26,19 @@ namespace NewHorizons.Handlers
|
||||
_entryIDsToNHBody = new Dictionary<string, NewHorizonsBody>();
|
||||
_nhBodyToAstroIDs = new Dictionary<NewHorizonsBody, string>();
|
||||
|
||||
List<GameObject> gameObjects = SearchUtilities.GetAllChildren(SearchUtilities.Find(PAN_ROOT_PATH));
|
||||
GameObject panRoot = SearchUtilities.Find(PAN_ROOT_PATH);
|
||||
if (panRoot != null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user