Bugfix: Incorrectly used driveline width instead of half driveline width, which means

the AI did not consider itself off road when it actually was. This fixed at least
some of the AI problems.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4153 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-10-27 12:32:42 +00:00
parent 8ac714a8f6
commit 362fa27e58

View File

@ -364,12 +364,13 @@ void DefaultRobot::handleSteering(float dt)
*/
//Reaction to being outside of the road
if( fabsf(m_world->getDistanceToCenterForKart( getWorldKartId() )) + 0.5f >
m_quad_graph->getNode(m_track_node).getPathWidth() )
0.5f* m_quad_graph->getNode(m_track_node).getPathWidth() )
{
steer_angle = steerToPoint(m_quad_graph->getQuad(next).getCenter(),
dt );
#ifdef AI_DEBUG
m_debug_sphere->setPosition(m_quad_graph->getQuad(next).getCenter().toIrrVector());
std::cout << "- Outside of road: steer to center point." <<
std::endl;
#endif