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:
parent
8ac714a8f6
commit
362fa27e58
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user