private void OnGetState(EntityUid uid, MovementSpeedModifierComponent component, ref ComponentGetState args) { args.State = new MovementSpeedModifierComponentState { BaseWalkSpeed = component.BaseWalkSpeed, BaseSprintSpeed = component.BaseSprintSpeed, WalkSpeedModifier = component.WalkSpeedModifier, SprintSpeedModifier = component.SprintSpeedModifier, }; }
private void OnHandleState(EntityUid uid, MovementSpeedModifierComponent component, ref ComponentHandleState args) { if (args.Current is not MovementSpeedModifierComponentState state) { return; } component.BaseWalkSpeed = state.BaseWalkSpeed; component.BaseSprintSpeed = state.BaseSprintSpeed; component.WalkSpeedModifier = state.WalkSpeedModifier; component.SprintSpeedModifier = state.SprintSpeedModifier; }
protected void OnChanged() { MovementSpeedModifierComponent.RefreshItemModifiers(Owner); }