From: <hik...@us...> - 2010-11-23 06:04:42
|
Revision: 6702 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6702&view=rev Author: hikerstk Date: 2010-11-23 06:04:35 +0000 (Tue, 23 Nov 2010) Log Message: ----------- 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. Modified Paths: -------------- main/trunk/src/items/plunger.cpp main/trunk/src/items/rubber_band.cpp main/trunk/src/items/rubber_band.hpp Modified: main/trunk/src/items/plunger.cpp =================================================================== --- main/trunk/src/items/plunger.cpp 2010-11-23 02:00:22 UTC (rev 6701) +++ main/trunk/src/items/plunger.cpp 2010-11-23 06:04:35 UTC (rev 6702) @@ -121,7 +121,7 @@ Plunger::~Plunger() { if(m_rubber_band) - m_rubber_band->removeFromScene(); + delete m_rubber_band; } // ~Plunger // ----------------------------------------------------------------------------- Modified: main/trunk/src/items/rubber_band.cpp =================================================================== --- main/trunk/src/items/rubber_band.cpp 2010-11-23 02:00:22 UTC (rev 6701) +++ main/trunk/src/items/rubber_band.cpp 2010-11-23 06:04:35 UTC (rev 6702) @@ -82,15 +82,18 @@ } // 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 * end position of the rubber band, i.e. the side attached to the plunger, Modified: main/trunk/src/items/rubber_band.hpp =================================================================== --- main/trunk/src/items/rubber_band.hpp 2010-11-23 02:00:22 UTC (rev 6701) +++ main/trunk/src/items/rubber_band.hpp 2010-11-23 06:04:35 UTC (rev 6702) @@ -64,8 +64,8 @@ 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |