Bugfix: restarting a race would not reset the AI properly, causing them to be rescued over and over.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4441 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-01-12 11:15:50 +00:00
parent 20643c1a44
commit bc378d4ebd
2 changed files with 3 additions and 2 deletions

View File

@ -973,6 +973,8 @@ void DefaultRobot::reset()
m_distance_ahead = 0.0f;
m_kart_behind = NULL;
m_distance_behind = 0.0f;
AutoKart::reset();
m_track_node = QuadGraph::UNKNOWN_SECTOR;
m_quad_graph->findRoadSector(getXYZ(), &m_track_node);
if(m_track_node==QuadGraph::UNKNOWN_SECTOR)
@ -982,7 +984,6 @@ void DefaultRobot::reset()
m_track_node = m_quad_graph->findOutOfRoadSector(getXYZ());
}
AutoKart::reset();
} // reset
//-----------------------------------------------------------------------------

View File

@ -1034,6 +1034,7 @@ void NewAI::reset()
m_kart_behind = NULL;
m_distance_behind = 0.0f;
m_track_node = QuadGraph::UNKNOWN_SECTOR;
AutoKart::reset();
m_quad_graph->findRoadSector(getXYZ(), &m_track_node);
if(m_track_node==QuadGraph::UNKNOWN_SECTOR)
{
@ -1042,7 +1043,6 @@ void NewAI::reset()
m_track_node = m_quad_graph->findOutOfRoadSector(getXYZ());
}
AutoKart::reset();
} // reset
//-----------------------------------------------------------------------------