From 59e8aa0c39287f539b3a2f008368675ff480aa3d Mon Sep 17 00:00:00 2001 From: psyGamer Date: Wed, 1 Jan 2025 23:16:28 +0100 Subject: [PATCH] fix: Analog inputs without an angle --- .../Source/TAS/Input/InputFrame.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CelesteTAS-EverestInterop/Source/TAS/Input/InputFrame.cs b/CelesteTAS-EverestInterop/Source/TAS/Input/InputFrame.cs index 4934e8ff..26020d03 100644 --- a/CelesteTAS-EverestInterop/Source/TAS/Input/InputFrame.cs +++ b/CelesteTAS-EverestInterop/Source/TAS/Input/InputFrame.cs @@ -51,9 +51,14 @@ private InputFrame(ActionLine actionLine, int studioLine, int repeatIndex, int r actionLineString = actionLine.ToString(); checksum = actionLineString.GetHashCode(); - if (float.TryParse(actionLine.FeatherAngle, out float angle)) { - float magnitude = float.TryParse(actionLine.FeatherMagnitude, out float m) ? m : 1.0f; - (StickPosition, StickPositionShort) = AnalogHelper.ComputeAngleVector(angle, magnitude); + if (Actions.Has(Actions.Feather)) { + if (float.TryParse(actionLine.FeatherAngle, out float angle)) { + float magnitude = float.TryParse(actionLine.FeatherMagnitude, out float m) ? m : 1.0f; + (StickPosition, StickPositionShort) = AnalogHelper.ComputeAngleVector(angle, magnitude); + } else { + // Fallback to 0° + (StickPosition, StickPositionShort) = AnalogHelper.ComputeAngleVector(0.0f, 1.0f); + } } if (Actions.Has(Actions.LeftDashOnly)) {