From da11b8c1c930033d3dd7c95261470408bf2e938d Mon Sep 17 00:00:00 2001 From: auria Date: Sun, 7 Aug 2011 01:33:19 +0000 Subject: [PATCH] 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 --- src/karts/kart.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 0970466b9..7ec0bb11a 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -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