@@ -175,7 +175,6 @@ int HDFirearm::ReadProperty(const std::string_view &propName, Reader &reader) {
175
175
} else if (propName == " DeactivationSound" ) {
176
176
m_DeactivationSound = new SoundContainer;
177
177
reader >> m_DeactivationSound;
178
- m_DeactivationSound->SetSoundOverlapMode (SoundContainer::SoundOverlapMode::RESTART);
179
178
} else if (propName == " EmptySound" ) {
180
179
m_EmptySound = new SoundContainer;
181
180
reader >> m_EmptySound;
@@ -619,6 +618,7 @@ void HDFirearm::Activate() {
619
618
HeldDevice::Activate ();
620
619
621
620
if (!IsReloading ()) {
621
+ if (m_DeactivationSound && m_DeactivationSound->IsBeingPlayed ()) { m_DeactivationSound->FadeOut (); }
622
622
if (m_ActiveSound && !m_ActiveSound->IsBeingPlayed ()) { m_ActiveSound->Play (this ->m_Pos ); }
623
623
if (m_PreFireSound && !wasActivated && !m_PreFireSound->IsBeingPlayed ()) { m_PreFireSound->Play (this ->m_Pos ); }
624
624
}
@@ -636,9 +636,9 @@ void HDFirearm::Deactivate() {
636
636
HeldDevice::Deactivate ();
637
637
m_FiredOnce = false ;
638
638
639
- if (m_PreFireSound) { m_PreFireSound->Stop (); }
639
+ if (m_PreFireSound) { m_PreFireSound->FadeOut (); }
640
640
if (m_FireSound && m_FireSound->GetLoopSetting () == -1 ) { m_FireSound->Stop (); }
641
- if (m_DeactivationSound && wasActivated && m_pMagazine && !m_pMagazine-> IsEmpty () ) { m_DeactivationSound->Play (m_Pos); }
641
+ if (m_DeactivationSound && wasActivated && m_FiredLastFrame ) { m_DeactivationSound->Play (m_Pos); }
642
642
}
643
643
644
644
// ////////////////////////////////////////////////////////////////////////////////////////
@@ -683,7 +683,10 @@ void HDFirearm::Reload()
683
683
684
684
// Stop any activation
685
685
m_Activated = false ;
686
- if (m_FireSound && m_FireSound->GetLoopSetting () == -1 && m_FireSound->IsBeingPlayed ()) { m_FireSound->Stop (); }
686
+ if (m_FireSound && m_FireSound->IsBeingPlayed ()) {
687
+ if (m_FireSound->GetLoopSetting () == -1 ) { m_FireSound->Stop (); }
688
+ if (m_DeactivationSound) { m_DeactivationSound->Play (); }
689
+ }
687
690
if (m_ReloadStartSound) { m_ReloadStartSound->Play (m_Pos); }
688
691
689
692
m_ReloadTmr.Reset ();
@@ -955,11 +958,9 @@ void HDFirearm::Update()
955
958
// Do stuff to deactivate after being activated
956
959
if (!m_Activated)
957
960
{
958
- if (m_AlreadyClicked && m_FiredLastFrame && m_DeactivationSound) { m_DeactivationSound->Play (m_Pos); }
959
961
// Reset the click indicator.
960
962
m_AlreadyClicked = false ;
961
963
962
- if (m_PreFireSound) { m_PreFireSound->Stop (); }
963
964
// Stop any looping activation sounds
964
965
if (m_FireSound && m_FireSound->GetLoopSetting () == -1 )// && m_FireSound->IsBeingPlayed())
965
966
m_FireSound->Stop ();
0 commit comments