Make sure no kart animation exists during goal reset

This commit is contained in:
Benau 2021-05-02 00:37:35 +08:00
parent 4081efbcaa
commit 261932e7b1

View File

@ -706,6 +706,12 @@ void SoccerWorld::resetKartsToSelfGoals()
if (kart->isEliminated())
continue;
if (kart->getKartAnimation())
{
AbstractKartAnimation* ka = kart->getKartAnimation();
kart->setKartAnimation(NULL);
delete ka;
}
kart->getBody()->setLinearVelocity(Vec3(0.0f));
kart->getBody()->setAngularVelocity(Vec3(0.0f));
unsigned index = m_kart_position_map.at(kart->getWorldKartId());