Fix "Wrong Direction" message
This commit is contained in:
parent
fbf002bfc6
commit
f40fb50386
@ -866,8 +866,10 @@ void LinearWorld::checkForWrongDirection(unsigned int i)
|
||||
return;
|
||||
|
||||
// check if the player is going in the wrong direction
|
||||
float angle_diff = kart->getHeading() -
|
||||
m_track->getAngle(sector);
|
||||
GraphNode& node = QuadGraph::get()->getNode(sector);
|
||||
Vec3 center_line = node.getUpperCenter() - node.getLowerCenter();
|
||||
float angle_diff = kart->getVelocity().angle(center_line);
|
||||
|
||||
if(angle_diff > M_PI) angle_diff -= 2*M_PI;
|
||||
else if (angle_diff < -M_PI) angle_diff += 2*M_PI;
|
||||
// Display a warning message if the kart is going back way (unless
|
||||
|
Loading…
Reference in New Issue
Block a user