From b5bb733e190890b24c618fb968b6a2ea765db983 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Sun, 5 Feb 2012 22:33:17 +0000 Subject: [PATCH] Make the karts start just ahead of the starting line in reverse mode. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/reverse_mode@10810 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/tracks/quad_graph.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tracks/quad_graph.cpp b/src/tracks/quad_graph.cpp index d3c20de9b..362996af3 100644 --- a/src/tracks/quad_graph.cpp +++ b/src/tracks/quad_graph.cpp @@ -330,8 +330,13 @@ void QuadGraph::setDefaultStartPositions(AlignedArray float sidewards_distance, float upwards_distance) const { - // Node 0 is always the node on which the start line is. - int current_node = getNode(0).getPredecessor(); + // In non-reverse mode: node 0 is the node on which the start line is. + // So get its predecessor (which is therefore just + // before the start line) to find the first quad + // to place karts on. + // In reverse mode, karts can start to placed on quad 0. + int current_node = m_reverse ? getNode(0).getIndex() + : getNode(0).getPredecessor(); float distance_from_start = 0.1f+forwards_distance;