From 9de5258867968aa180c3968972482bda751a1c00 Mon Sep 17 00:00:00 2001 From: auria Date: Tue, 16 Dec 2008 21:31:02 +0000 Subject: [PATCH] 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 --- src/karts/kart.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index d7e94dd19..653cee74a 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -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)