terrain sound is not necessarily a looping sound so check its status before setting its speed, to avoid 'ressuscitating' sounds that had already stopped

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11160 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-04-25 22:39:25 +00:00
parent 9728e8514e
commit e9b3a36041

View File

@ -1249,7 +1249,10 @@ void Kart::handleMaterialSFX(const Material *material)
sfx_manager->deleteSFX(m_previous_terrain_sound);
m_previous_terrain_sound = NULL;
}
if(m_terrain_sound)
// terrain sound is not necessarily a looping sound so check its status before
// setting its speed, to avoid 'ressuscitating' sounds that had already stopped
if(m_terrain_sound && m_terrain_sound->getStatus() == SFXManager::SFX_PLAYING)
{
m_terrain_sound->position(getXYZ());
material->setSFXSpeed(m_terrain_sound, m_speed);