Don't play crash sound when kart is not moving
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9440 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
847e25fa0a
commit
da11b8c1c9
@ -1324,11 +1324,14 @@ void Kart::crashed(Kart *k, const Material *m)
|
||||
// karts from bouncing back, they will instead stuck towards the obstable).
|
||||
if(m_bounce_back_time<=0.0f)
|
||||
{
|
||||
// In case that the sfx is longer than 0.5 seconds, only play it if
|
||||
// it's not already playing.
|
||||
if(m_crash_sound->getStatus() != SFXManager::SFX_PLAYING)
|
||||
m_crash_sound->play();
|
||||
|
||||
if (fabsf(m_vehicle->getCurrentSpeedKmHour() > 2.0f))
|
||||
{
|
||||
// In case that the sfx is longer than 0.5 seconds, only play it if
|
||||
// it's not already playing.
|
||||
if(m_crash_sound->getStatus() != SFXManager::SFX_PLAYING)
|
||||
m_crash_sound->play();
|
||||
}
|
||||
|
||||
m_bounce_back_time = 0.1f;
|
||||
}
|
||||
} // crashed
|
||||
|
Loading…
Reference in New Issue
Block a user