From eb3f2b4ece6c1746ab2f7bc34d869ac4828fe660 Mon Sep 17 00:00:00 2001 From: Nishchal Chandna Date: Mon, 25 Aug 2025 05:02:04 -0400 Subject: [PATCH] Fix bug in calculation of the closest normal direction. We compare absolute values, but then store the plain value as the current max. This breaks in the case where the closest off is a negative dot product, but is overridden by a subsequent, smaller positive dot product. How did I find this? Well it apparently happened enough times in game for me to notice that the arrow was often pointing in the wrong direction. --- .../Utilities/Extensions/DirectionConversion.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HitScoreVisualizer/Utilities/Extensions/DirectionConversion.cs b/HitScoreVisualizer/Utilities/Extensions/DirectionConversion.cs index 6625d08..cedefaa 100644 --- a/HitScoreVisualizer/Utilities/Extensions/DirectionConversion.cs +++ b/HitScoreVisualizer/Utilities/Extensions/DirectionConversion.cs @@ -57,10 +57,10 @@ private static Direction GetClosestOffDirection(Vector3 cutNormal) { continue; } - closestDot = dot; + closestDot = dotValue; result = direction; } return result; } -} \ No newline at end of file +}