source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

[HL2MP] Func_movelinear fixes

Open speedvoltage opened this issue 9 months ago • 0 comments

Issue: The movement calculations for CFuncMoveLinear were using GetAbsOrigin(), which caused inconsistencies when the entity was parented. This led to incorrect position updates and movement-related issues. Additionally, movement sounds were not dynamically adjusting based on speed.

Fix:

  1. Replaced GetAbsOrigin() with GetLocalOrigin() to ensure position calculations remain relative to the entity’s local origin.
  2. Introduced UpdateMoveSound() to dynamically adjust pitch and playback of movement sounds based on entity speed.
  3. Integrated UpdateMoveSound() into movement functions (MoveTo() and LinearMoveDone()) to ensure seamless audio transitions as the entity moves.

speedvoltage avatar Mar 14 '25 21:03 speedvoltage