From cd65a23e129f337fd916bc9e014098d100fd8e43 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Mon, 15 Aug 2022 07:03:29 -0400 Subject: [PATCH] Simplify --- NewHorizons/Handlers/SupernovaEffectHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/SupernovaEffectHandler.cs b/NewHorizons/Handlers/SupernovaEffectHandler.cs index 760b99b3..cd27312a 100644 --- a/NewHorizons/Handlers/SupernovaEffectHandler.cs +++ b/NewHorizons/Handlers/SupernovaEffectHandler.cs @@ -55,7 +55,7 @@ namespace NewHorizons.Handlers if (starEvolutionController == null) continue; if (starEvolutionController._disabled) continue; float distance = (supernovaPlanetEffectController.transform.position - starEvolutionController.transform.position).sqrMagnitude; - if (starEvolutionController.IsPointInsideMaxSupernova(supernovaPlanetEffectController.transform.position) && distance < nearestDistance) + if (distance < (starEvolutionController.supernovaSize * starEvolutionController.supernovaSize) && distance < nearestDistance) { nearestDistance = distance; nearestStarEvolutionController = starEvolutionController; @@ -65,7 +65,7 @@ namespace NewHorizons.Handlers if (_sunController != null && _sunController.gameObject.activeSelf) { float distance = (supernovaPlanetEffectController.transform.position - _sunController.transform.position).sqrMagnitude; - if (InPointInsideSunSupernova(supernovaPlanetEffectController) && distance < nearestDistance) + if (distance < 2500000000f && distance < nearestDistance) { supernovaPlanetEffectController._sunController = _sunController; supernovaPlanetEffectController._starEvolutionController = null;