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

Commit 97436aa

Browse files
committed
HDFirearm fix related to looping FireSounds sometimes refusing to stop
1 parent e7ad0dd commit 97436aa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Entities/HDFirearm.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ void HDFirearm::Activate() {
619619
if (!IsReloading()) {
620620
if (m_ActiveSound && !m_ActiveSound->IsBeingPlayed()) { m_ActiveSound->Play(this->m_Pos); }
621621
if (m_PreFireSound && !wasActivated && !m_PreFireSound->IsBeingPlayed()) { m_PreFireSound->Play(this->m_Pos); }
622-
if (IsEmpty() && m_FireSound && m_FireSound->GetLoopSetting() == -1 && m_FireSound->IsBeingPlayed()) { m_FireSound->Stop(); }
622+
if (IsEmpty()) { Deactivate(); }
623623
}
624624
}
625625

@@ -680,9 +680,7 @@ void HDFirearm::Reload()
680680
m_pMagazine = 0;
681681
}
682682

683-
// Stop any activation
684-
m_Activated = false;
685-
if (m_FireSound && m_FireSound->GetLoopSetting() == -1 && m_FireSound->IsBeingPlayed()) { m_FireSound->Stop(); }
683+
Deactivate();
686684
if (m_ReloadStartSound) { m_ReloadStartSound->Play(m_Pos); }
687685

688686
m_ReloadTmr.Reset();

0 commit comments

Comments
 (0)