GetPlanet bugfix (#1122)

## Bug fixes

- Make GetPlanet only check planets in the current system. This prevents
it from pulling the wrong config if a planet in another system has the
same name.
This commit is contained in:
xen-42 2025-09-13 19:12:45 -04:00 committed by GitHub
commit 4982f2a69a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,7 +83,7 @@ namespace NewHorizons
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;