Fixed #2294 (crash when kart is off road and not on material).

This commit is contained in:
hiker 2015-08-26 17:15:59 +10:00
parent 77098c9e7c
commit 267e6963c2

View File

@ -179,7 +179,8 @@ void LinearWorld::update(float dt)
// might get too close to another part of the track, shortly
// jump to position one, then on reset fall back to last)
if (!kart_info.getTrackSector()->isOnRoad() &&
kart->getMaterial()->isDriveReset())
(!kart->getMaterial() ||
kart->getMaterial()->isDriveReset()) )
continue;
kart_info.getTrackSector()->update(kart->getFrontXYZ());
kart_info.m_overall_distance = kart_info.m_race_lap