Fix assertion failure if a bomb explodes while in a cannon, see #2846 (the bug is not quite fixed)

This commit is contained in:
auria.mg 2017-05-04 19:12:17 -04:00
parent ec3a74f758
commit 553207fc11

View File

@ -129,6 +129,12 @@ void AbstractKart::setKartAnimation(AbstractKartAnimation *ka)
else Log::debug("Abstract_Kart", "Current kart animation is NULL.");
}
#endif
if (ka != NULL && m_kart_animation != NULL)
{
delete m_kart_animation;
m_kart_animation = NULL;
}
// Make sure that the either the current animation is NULL and a new (!=0)
// is set, or there is a current animation, then it must be set to 0. This
// makes sure that the calling logic of this function is correct.