Fix rare end race in network crash reported
This commit is contained in:
parent
c1f10d79cb
commit
22f1111dbe
@ -72,8 +72,11 @@ AbstractKart::AbstractKart(const std::string& ident,
|
||||
AbstractKart::~AbstractKart()
|
||||
{
|
||||
delete m_kart_model;
|
||||
if(m_kart_animation)
|
||||
if (m_kart_animation)
|
||||
{
|
||||
m_kart_animation->handleResetRace();
|
||||
delete m_kart_animation;
|
||||
}
|
||||
} // ~AbstractKart
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -82,8 +85,9 @@ void AbstractKart::reset()
|
||||
// important to delete animations before calling reset, as some animations
|
||||
// set the kart velocity in their destructor (e.g. cannon) which "reset"
|
||||
// can then cancel. See #2738
|
||||
if(m_kart_animation)
|
||||
if (m_kart_animation)
|
||||
{
|
||||
m_kart_animation->handleResetRace();
|
||||
delete m_kart_animation;
|
||||
m_kart_animation = NULL;
|
||||
}
|
||||
|
@ -108,6 +108,10 @@ public:
|
||||
int getEndTicks() const { return m_end_ticks; }
|
||||
// ------------------------------------------------------------------------
|
||||
virtual KartAnimationType getAnimationType() const = 0;
|
||||
// ------------------------------------------------------------------------
|
||||
/* Remove the timer changes by checkNetworkAnimationCreationSucceed if
|
||||
* m_kart has been eliminated by network. */
|
||||
void handleResetRace() { m_timer = 9999; }
|
||||
}; // AbstractKartAnimation
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user