Fix potential crash

This commit is contained in:
Benau 2016-02-07 00:56:14 +08:00
parent c3f589561c
commit af5b23e5c6

View File

@ -333,7 +333,8 @@ void SkiddingAI::update(float dt)
// If we are faster, try to predict the point where we will hit
// the other kart
if(m_kart_ahead->getSpeed() < m_kart->getSpeed())
if((m_kart_ahead->getSpeed() < m_kart->getSpeed()) &&
!m_kart_ahead->isGhostKart())
{
float time_till_hit = m_distance_ahead
/ (m_kart->getSpeed()-m_kart_ahead->getSpeed());