Going from one driveline sector to the next is now never

considered to be a shortcut (in case that some new track
has a secgtor length of more than 90).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2893 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-01-13 03:00:15 +00:00
parent 4b814336ce
commit 6773718dbd

View File

@ -485,6 +485,10 @@ bool Track::isShortcut(const int OLDSEC, const int NEWSEC) const
{
// If the kart was off the road, don't do any shortcuts
if(OLDSEC==UNKNOWN_SECTOR || NEWSEC==UNKNOWN_SECTOR) return false;
int next_sector = OLDSEC==(int)m_driveline.size()-1 ? 0 : OLDSEC+1;
if(next_sector==NEWSEC)
return false;
int distance_sectors = (int)(m_distance_from_start[std::max(NEWSEC, OLDSEC)] -
m_distance_from_start[std::min(NEWSEC, OLDSEC)] );