diff --git a/tests/AcDream.Core.Tests/Physics/MotionInterpreterTests.cs b/tests/AcDream.Core.Tests/Physics/MotionInterpreterTests.cs index addc9fa..1b7d05e 100644 --- a/tests/AcDream.Core.Tests/Physics/MotionInterpreterTests.cs +++ b/tests/AcDream.Core.Tests/Physics/MotionInterpreterTests.cs @@ -873,4 +873,19 @@ public sealed class MotionInterpreterTests Assert.Equal(0f, speed, precision: 4); } + + [Fact] + public void GetMaxSpeed_RunForward_NoWeenie_FallsBackToMyRunRate() + { + // WeenieObj is null (MakeInterp with no weenie argument); MyRunRate + // is set explicitly. GetMaxSpeed must use MyRunRate as the run-rate + // source when InqRunRate is unavailable. + var interp = MakeInterp(); + interp.MyRunRate = 1.75f; + interp.InterpretedState.ForwardCommand = MotionCommand.RunForward; + + float speed = interp.GetMaxSpeed(); + + Assert.Equal(MotionInterpreter.RunAnimSpeed * 1.75f, speed, precision: 4); + } }