Skip to content

Commit

Permalink
Add snd_throw and snd_throw_begin sounds for CMissile
Browse files Browse the repository at this point in the history
  • Loading branch information
Shtrecker authored and Drombeys committed Mar 4, 2025
1 parent 84e2a8e commit 412f2f8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/xrGame/Missile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ void CMissile::Load(LPCSTR section)
if (pSettings->line_exist(section, "snd_holster"))
m_sounds.LoadSound(section, "snd_holster", "SndHide", false, ESoundTypes(SOUND_TYPE_ITEM_HIDING));

if (pSettings->line_exist(section, "snd_throw_begin"))
m_sounds.LoadSound(section, "snd_throw_begin", "sndThrowBegin", false, ESoundTypes(SOUND_TYPE_ITEM_TAKING));

if (pSettings->line_exist(section, "snd_throw"))
m_sounds.LoadSound(section, "snd_throw", "sndThrow", false, ESoundTypes(SOUND_TYPE_ITEM_HIDING));

if (pSettings->line_exist(section, "checkout_bones"))
{
m_sCheckoutBones.clear();
Expand Down Expand Up @@ -272,6 +278,12 @@ void CMissile::UpdateCL()

if (m_sounds.FindSoundItem("SndHide", false))
m_sounds.SetPosition("SndHide", P);

if (m_sounds.FindSoundItem("sndThrow", false))
m_sounds.SetPosition("sndThrow", P);

if (m_sounds.FindSoundItem("sndThrowBegin", false))
m_sounds.SetPosition("sndThrowBegin", P);
}

void CMissile::shedule_Update(u32 dt)
Expand Down Expand Up @@ -334,6 +346,8 @@ void CMissile::State(u32 state)
{
SetPending (TRUE);
m_fThrowForce = m_fMinForce;
if (m_sounds.FindSoundItem("sndThrowBegin", false))
PlaySound("sndThrowBegin", Position());
PlayHUDMotion ("anm_throw_begin", TRUE, this, GetState());
} break;
case eReady:
Expand All @@ -344,6 +358,8 @@ void CMissile::State(u32 state)
{
SetPending (TRUE);
m_throw = false;
if (m_sounds.FindSoundItem("sndThrow", false))
PlaySound("sndThrow", Position());
PlayHUDMotion ("anm_throw", TRUE, this, GetState());
} break;
case eThrowEnd:
Expand Down

0 comments on commit 412f2f8

Please sign in to comment.