Skip to content
Prev Previous commit
Next Next commit
pointer fix
  • Loading branch information
Kutez committed Apr 13, 2025
commit 2a2a1c14760a91941083d996b9c39e4c20e8ef55
2 changes: 1 addition & 1 deletion src/xrGame/HudSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void HUD_SOUND_ITEM::PlaySound(HUD_SOUND_ITEM& hud_snd,
flags & sm_2D
? &Fvector().set(0, 0, 0)
: &Fvector().set(position.x, position.y, position.z),
volume_mult, 0, 0);
&volume_mult, 0, 0);
}

//hud_snd.m_activeSnd->snd.set_volume (hud_snd.m_activeSnd->volume * b_hud_mode?psHUDSoundVolume:1.0f);
Expand Down
16 changes: 16 additions & 0 deletions src/xrGame/WeaponMagazined.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ void CWeaponMagazined::Load(LPCSTR section)
if (WeaponSoundExist(section, "snd_silncer_shoot_actor_first"))
m_sounds.LoadSound(section, "snd_silncer_shoot_actor_first", "sndSilencerShotActorFirst", false, m_eSoundShot);

// Indoor
if (WeaponSoundExist(section, "snd_silncer_shoot_indoor"))
m_sounds.LoadSound(section, "snd_silncer_shoot_indoor", "sndSilencerShotIndoor", false, m_eSoundShot);

//misfire shot
if (WeaponSoundExist(section, "snd_silncer_shot_misfire"))
m_sounds.LoadSound(section, "snd_silncer_shot_misfire", "sndSilencerShotMisfire", false, m_eSoundShot);
Expand Down Expand Up @@ -914,6 +918,7 @@ void CWeaponMagazined::PlaySoundShot()
}
}


if (bMisfire)
{
string128 sndNameMisfire;
Expand All @@ -925,6 +930,17 @@ void CWeaponMagazined::PlaySoundShot()
}
}

if (g_gunsnd_indoor>0.f)
{
string128 sndNameIndoor;
strconcat(sizeof(sndNameIndoor), sndNameIndoor, m_sSndShotCurrent.c_str(), "Indoor");
if (m_sounds.FindSoundItem(sndNameIndoor, false))
{
m_sounds.PlaySound(sndNameIndoor, get_LastFP(), H_Root(), !!GetHUDmode(), false, (u8)-1, 1.0f);
return;
}
}

m_sounds.PlaySound(m_sSndShotCurrent.c_str(), get_LastFP(), H_Root(), !!GetHUDmode(), false, (u8)-1);
}

Expand Down