fixed potential crash in previous commit

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2702 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2008-12-16 21:31:02 +00:00
parent f235baafed
commit 9de5258867

View File

@ -572,7 +572,8 @@ void Kart::update(float dt)
if (getHoT()==Track::NOHIT) // kart falling off the track
{
// let kart fall a bit before rescuing
if( abs( getXYZ().getZ() - RaceManager::getTrack()->m_left_driveline[0].getZ() ) > 17)
if( RaceManager::getTrack()->m_left_driveline.size() > 0 &&
abs( getXYZ().getZ() - RaceManager::getTrack()->m_left_driveline[0].getZ() ) > 17)
forceRescue();
}
else if(material)