Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 4fa86e9

Browse files
committed
Add more support for looping stride sounds
1 parent bb6a04f commit 4fa86e9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Entities/AHuman.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3582,14 +3582,20 @@ void AHuman::Update()
35823582
}
35833583
bool climbing = m_ArmClimbing[FGROUND] || m_ArmClimbing[BGROUND];
35843584

3585+
if (m_StrideSound) {
3586+
m_StrideSound->SetPosition(m_Pos);
3587+
if (m_StrideSound->GetLoopSetting() < 0) {
3588+
if (!m_StrideSound->IsBeingPlayed()) { m_StrideSound->Play(); }
3589+
} else if (restarted && !climbing) {
3590+
m_StrideSound->Play();
3591+
}
35853592
}
35863593
if (restarted) {
3587-
if (!climbing) {
3588-
if (m_StrideSound) { m_StrideSound->Play(m_Pos); }
3589-
RunScriptedFunctionInAppropriateScripts("OnStride");
3594+
if (climbing) {
3595+
m_WalkAngle[FGROUND] = Matrix();
3596+
m_WalkAngle[BGROUND] = Matrix();
35903597
} else {
3591-
m_WalkAngle[FGROUND] = Matrix();
3592-
m_WalkAngle[BGROUND] = Matrix();
3598+
RunScriptedFunctionInAppropriateScripts("OnStride");
35933599
}
35943600
}
35953601

0 commit comments

Comments
 (0)