mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
updated the rest of AstroObjectLocator to account for there now being multiple keys per astro object
This commit is contained in:
parent
f30320e758
commit
bfcee12e64
@ -77,17 +77,18 @@ namespace NewHorizons.Utility
|
||||
public static void DeregisterCustomAstroObject(AstroObject ao)
|
||||
{
|
||||
var key = ao._name == AstroObject.Name.CustomString ? ao.GetCustomName() : ao._name.ToString();
|
||||
_customAstroObjectDictionary.Remove(key);
|
||||
_customAstroObjectDictionary.Remove(key);
|
||||
_customAstroObjectDictionary.Remove(ao.name);
|
||||
}
|
||||
|
||||
public static AstroObject[] GetAllAstroObjects()
|
||||
{
|
||||
return _customAstroObjectDictionary.Values.ToArray();
|
||||
return _customAstroObjectDictionary.Values.Distinct().ToArray();
|
||||
}
|
||||
|
||||
public static GameObject[] GetMoons(AstroObject primary)
|
||||
{
|
||||
return _customAstroObjectDictionary.Values.Where(x => x._primaryBody == primary).Select(x => x.gameObject).ToArray();
|
||||
return _customAstroObjectDictionary.Values.Distinct().Where(x => x._primaryBody == primary).Select(x => x.gameObject).ToArray();
|
||||
}
|
||||
|
||||
public static GameObject[] GetChildren(AstroObject primary)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user