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:
parent
846a387a1b
commit
6fa0eea7b4
@ -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
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user