From 42bbe4bcceb89543d57a26ac7b46a1015782dd1c Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 4 Aug 2023 19:31:41 -0700 Subject: [PATCH 1/2] planet destruction: also exclude probe --- NewHorizons/Handlers/PlanetDestructionHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/PlanetDestructionHandler.cs b/NewHorizons/Handlers/PlanetDestructionHandler.cs index 79f65cb6..ec9d1674 100644 --- a/NewHorizons/Handlers/PlanetDestructionHandler.cs +++ b/NewHorizons/Handlers/PlanetDestructionHandler.cs @@ -60,7 +60,7 @@ namespace NewHorizons.Handlers // Collect all rigid bodies and proxies foreach (var rigidbody in CenterOfTheUniverse.s_rigidbodies) { - if (rigidbody.name is not "Player_Body" && rigidbody.name is not "Ship_Body") + if (rigidbody.name is not ("Player_Body" or "Probe_Body" or "Ship_Body")) { toDisable.Add(rigidbody.gameObject); } From 0ce611e36f3cf3a6e05458f0ef6e9074145dbbb9 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Fri, 4 Aug 2023 19:32:36 -0700 Subject: [PATCH 2/2] simplify another pattern --- NewHorizons/Handlers/PlanetCreationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index aca59e13..45520195 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -66,7 +66,7 @@ namespace NewHorizons.Handlers var starLightGO = UnityEngine.Object.Instantiate(sun.GetComponentInChildren().gameObject); foreach (var comp in starLightGO.GetComponents()) { - if (comp is not SunLightController && comp is not SunLightParamUpdater && comp is not Light && comp is not Transform) + if (comp is not (SunLightController or SunLightParamUpdater or Light or Transform)) { UnityEngine.Object.Destroy(comp); }