Bugfix: a crash would happen if a kart that is eliminated

had a plunger flying around.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2894 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-01-13 03:25:19 +00:00
parent 6773718dbd
commit b21d98e5ea

View File

@ -88,6 +88,15 @@ void RubberBand::removeFromScene()
*/
void RubberBand::update(float dt)
{
if(m_owner.isEliminated())
{
// Rubber band snaps
m_plunger->hit(NULL);
// This causes the plunger to be removed at the next update
m_plunger->setKeepAlive(0.0f);
return;
}
Vec3 p;
const Vec3 &k = m_owner.getXYZ();