mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Make GetPlanet work if planets across systems have the same name
This commit is contained in:
parent
999bcae536
commit
9f5b71e1cc
@ -83,7 +83,7 @@ namespace NewHorizons
|
|||||||
|
|
||||||
public GameObject GetPlanet(string name)
|
public GameObject GetPlanet(string name)
|
||||||
{
|
{
|
||||||
return Main.BodyDict.Values.SelectMany(x => x)?.ToList()?.FirstOrDefault(x => x.Config.name == name)?.Object;
|
return Main.BodyDict[Main.Instance.CurrentStarSystem].FirstOrDefault(x => x.Config.name == name)?.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetCurrentStarSystem() => Main.Instance.CurrentStarSystem;
|
public string GetCurrentStarSystem() => Main.Instance.CurrentStarSystem;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user