Fix #495: everlasting bomb - caused by getting a new

item while a swatter was playing the remove-bomb
animation. In this case the bomb scene node was
not removed.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11901 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2012-11-08 21:03:31 +00:00
parent c316abda19
commit 2cb5c6475e

View File

@ -50,7 +50,7 @@
* was a bomb attached, it triggers the replace bomb animations.
* \param attachment The attachment instance where the swatter is attached to.
* \param kart The kart to which the swatter is attached.
* \param was_bomb True if the kart had a bomv as attachment.
* \param was_bomb True if the kart had a bomb as attachment.
* \param bomb_scene_node The scene node of the bomb (i.e. the previous
* attachment scene node).
*/
@ -93,6 +93,11 @@ Swatter::Swatter(AbstractKart *kart, bool was_bomb,
*/
Swatter::~Swatter()
{
if(m_bomb_scene_node)
{
irr_driver->removeNode(m_bomb_scene_node);
m_bomb_scene_node = NULL;
}
if (m_swat_sound)
{
sfx_manager->deleteSFX(m_swat_sound);