Make GetPlanet work if planets across systems have the same name

This commit is contained in:
coderCleric 2025-08-23 15:45:59 -06:00
parent 999bcae536
commit 9f5b71e1cc

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;