source-sdk-2013
source-sdk-2013 copied to clipboard
[HL2MP] Func_movelinear fixes
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:
- Replaced
GetAbsOrigin()withGetLocalOrigin()to ensure position calculations remain relative to the entity’s local origin. - Introduced
UpdateMoveSound()to dynamically adjust pitch and playback of movement sounds based on entity speed. - Integrated
UpdateMoveSound()into movement functions (MoveTo()andLinearMoveDone()) to ensure seamless audio transitions as the entity moves.