Improved location of custom SFX calls to avoid multiple calls being made simultaneously

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3906 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
rforder 2009-08-22 16:45:24 +00:00
parent 537c90dd41
commit e8dc5d4f4d
3 changed files with 9 additions and 4 deletions

View File

@ -160,7 +160,6 @@ void Attachment::moveBombFromTo(Kart *from, Kart *to)
from->getAttachment()->getTimeLeft()+
stk_config->m_bomb_time_increase, from);
to->playCustomSFX(SFXManager::CUSTOM_ATTACH);
from->getAttachment()->clear();
} // moveBombFromTo

View File

@ -862,9 +862,6 @@ void Kart::crashed(Kart *k)
if(m_crash_sound->getStatus() != SFXManager::SFX_PLAYING)
m_crash_sound->play();
// If we hit another kart, yell at it! (play custom kart sound)
if (k != NULL) playCustomSFX(SFXManager::CUSTOM_CRASH);
m_bounce_back_time = 0.1f;
}
} // crashed

View File

@ -192,6 +192,8 @@ void Physics::KartKartCollision(Kart *kartA, Kart *kartB)
if(attachmentA->getPreviousOwner()!=kartB)
{
attachmentA->moveBombFromTo(kartA, kartB);
// Play appropriate SFX
kartB->playCustomSFX(SFXManager::CUSTOM_ATTACH);
}
}
}
@ -199,6 +201,13 @@ void Physics::KartKartCollision(Kart *kartA, Kart *kartB)
attachmentB->getPreviousOwner()!=kartA)
{
attachmentB->moveBombFromTo(kartB, kartA);
kartA->playCustomSFX(SFXManager::CUSTOM_ATTACH);
}
else
{
// No bombs exchanged, no explosions, tell the other driver to move it!
kartA->playCustomSFX(SFXManager::CUSTOM_CRASH);
kartB->playCustomSFX(SFXManager::CUSTOM_CRASH);
}
} // KartKartCollision