fix(movement): remove unreferenced [0.25,3.0] clamp on local player's movSpd scale

CInstanceBase::SetMoveSpeed only guards moving_speed > 1100 -> 0; the local
player's set_server_speed() was additionally floor/ceil-clamping the scale to
an arbitrary [0.25, 3.0] band with no basis in the reference or in this
project's already-fixed remote-entity equivalent (EntityStore::motion_move_speed).
A heavy haste stack or slow debuff on the local player would silently diverge
from what everyone else sees. Removed the extra clamp; kept the moving_speed<=0
early-return guard against pre-spawn/malformed values.

audit: movement.keyboard.motion/server-speed-scale-clamp closed with reference
citation, regression test, and full related-suite pass; contract stays PARTIAL.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-22 16:31:17 +09:00
co-authored by Claude Sonnet 5
parent a4ac48db24
commit c5c183da37
6 changed files with 120 additions and 12 deletions
+7 -1
View File
@@ -274,7 +274,13 @@ func set_server_speed(moving_speed: int) -> void:
# pre-spawn zero values from freezing local prediction.
if moving_speed <= 0:
return
server_speed_scale = clampf(float(moving_speed) / 100.0, 0.25, 3.0)
# CInstanceBase::SetMoveSpeed(UINT uMovSpd): only guard is uMovSpd > 1100 ->
# 0 (frozen walk pose, no root-motion advance); otherwise uMovSpd/100.0f is
# applied unclamped. EntityStore::motion_move_speed already mirrors this for
# remote actors; there is no reference basis for an arbitrary [0.25, 3.0]
# band on the local player, so a big haste stack or heavy slow debuff must
# scale local prediction the same way it scales everyone else's remote view.
server_speed_scale = 0.0 if moving_speed > 1100 else float(moving_speed) / 100.0
func set_input_surfaces(cursor: Node, ui: Node = null, ground: Node = null,
cancel_fishing_cb := Callable(), ground_cancel_fishing_cb := Callable()) -> void: