diff --git a/src/modes/linear_world.cpp b/src/modes/linear_world.cpp index ae06e383c..e861d2061 100644 --- a/src/modes/linear_world.cpp +++ b/src/modes/linear_world.cpp @@ -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