Fix RemoveStarLight bugs

This commit is contained in:
TerrificTrifid 2022-09-14 23:10:05 -05:00
parent 3d1e450d6d
commit 13dfe1c535
2 changed files with 2 additions and 2 deletions

View File

@ -302,7 +302,7 @@ namespace NewHorizons.Components.SizeControllers
private void DisableStar(bool start = false)
{
if (controller != null) StarLightController.RemoveStar(controller);
StarLightController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent<Light>());
if (!isProxy) StarLightController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent<Light>());
if (_stellarRemnant != null)
{

View File

@ -118,7 +118,7 @@ namespace NewHorizons.Handlers
case AstroObject.Name.Sun:
var starController = ao.gameObject.GetComponent<StarController>();
StarLightController.RemoveStar(starController);
StarLightController.RemoveStarLight(ao.gameObject.FindChild("SunLight").GetComponent<Light>());
StarLightController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
GameObject.Destroy(starController);
var audio = ao.GetComponentInChildren<SunSurfaceAudioController>();