From 21d7b369d0f618a0815e4a78eb29da0bc572a7bb Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 24 Aug 2023 13:42:35 -0400 Subject: [PATCH] Only destroy daynight/villagemusic on TH --- NewHorizons/Handlers/PlanetDestructionHandler.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Handlers/PlanetDestructionHandler.cs b/NewHorizons/Handlers/PlanetDestructionHandler.cs index 79a92b2e..9aa9e129 100644 --- a/NewHorizons/Handlers/PlanetDestructionHandler.cs +++ b/NewHorizons/Handlers/PlanetDestructionHandler.cs @@ -105,12 +105,12 @@ namespace NewHorizons.Handlers // Always just fucking kill this one to stop THE WARP BUG!!! GameObject.Destroy(SearchUtilities.Find("StreamingGroup_TH").gameObject); - // TODO: These should only destroy those that are on TH - foreach (var obj in UnityEngine.Object.FindObjectsOfType()) + var timberHearth = SearchUtilities.Find("TimberHearth_Body"); + foreach (var obj in timberHearth.GetComponentsInChildren()) { GameObject.Destroy(obj.gameObject); } - foreach (var obj in UnityEngine.Object.FindObjectsOfType()) + foreach (var obj in timberHearth.GetComponentsInChildren()) { GameObject.Destroy(obj.gameObject); }