Fix bug 3113806: when no kart animations are displayed

and a plunger is fired, the kart animation would
display the 'steer left' frame when the rubber band
is removed.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6702 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-11-23 06:04:35 +00:00
parent 846a387a1b
commit 6fa0eea7b4
3 changed files with 11 additions and 8 deletions

View File

@ -121,7 +121,7 @@ Plunger::Plunger(Kart *kart) : Flyable(kart, PowerupManager::POWERUP_PLUNGER)
Plunger::~Plunger()
{
if(m_rubber_band)
m_rubber_band->removeFromScene();
delete m_rubber_band;
} // ~Plunger
// -----------------------------------------------------------------------------

View File

@ -82,14 +82,17 @@ RubberBand::RubberBand(Plunger *plunger, const Kart &kart) :
} // RubberBand
// ----------------------------------------------------------------------------
/** Removes the rubber band from the scene. Is called when the plunger
* explodes.
*/
void RubberBand::removeFromScene()
RubberBand::~RubberBand()
{
irr_driver->removeNode(m_node);
irr_driver->removeMesh(m_mesh);
} // removeFromScene
// This mesh is self made and so not stored in the
// mesh cache. So no reason to call
// irr_driver->removeMesh(m_mesh);
// But it was implicitly 'grabbed' during creation, so we have
// to drop it here.
m_mesh->drop();
} // RubberBand
// ----------------------------------------------------------------------------
/** Updates the position of the rubber band. It especially sets the

View File

@ -64,8 +64,8 @@ private:
public:
RubberBand(Plunger *plunger, const Kart &kart);
~RubberBand();
void update(float dt);
void removeFromScene();
void hit(Kart *kart_hit, const Vec3 *track_xyz=NULL);
}; // RubberBand
#endif