From 1b4fdac13c4eeba98e1ce21fbc66433b69dab5e7 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 13 Apr 2026 00:51:39 +0200 Subject: [PATCH] fix(anim): pass resolved command (not original) to sequencer SetCycle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The left→right fallback resolved the cycle correctly but still passed the original TurnLeft/SideStepLeft command to the sequencer. The sequencer did its own internal cycle lookup with the left-side command and found nothing → no animation played. Fix: track which command actually resolved (after fallback) and pass that to SetCycle so the sequencer's internal lookup matches. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/AcDream.App/Rendering/GameWindow.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index e3f2dcf..cd3cd00 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -2057,6 +2057,7 @@ public sealed class GameWindow : IDisposable // AC reuses right-side animations for left-side motions (played in // reverse). If the left-side command has no cycle, fall back to the // right-side equivalent so the player isn't stuck in idle. + uint resolvedCommand = animCommand; // track which command actually resolved if (cycle is null || cycle.Framerate == 0f || cycle.HighFrame <= cycle.LowFrame) { ushort fallback = cmdOverride switch @@ -2073,17 +2074,20 @@ public sealed class GameWindow : IDisposable motionTableIdOverride: _playerMotionTableId, stanceOverride: NonCombatStance, commandOverride: fallback); + // Update resolvedCommand so the sequencer looks up the right cycle + resolvedCommand = (animCommand & 0xFF000000u) | fallback; } } if (cycle is null || cycle.Framerate == 0f || cycle.HighFrame <= cycle.LowFrame) return; // If the entity has a sequencer, use SetCycle for transition-link-aware - // motion switching. Otherwise update the legacy slerp path fields. + // motion switching. Pass the RESOLVED command (after left→right fallback) + // so the sequencer's internal cycle lookup finds the same animation. if (ae.Sequencer is not null) { uint fullStyle = 0x80000000u | (uint)NonCombatStance; - ae.Sequencer.SetCycle(fullStyle, animCommand); + ae.Sequencer.SetCycle(fullStyle, resolvedCommand); } ae.Animation = cycle.Animation;