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
This commit is contained in:
hikerstk 2012-02-05 22:33:17 +00:00
parent 80ec893758
commit b5bb733e19

View File

@ -330,8 +330,13 @@ void QuadGraph::setDefaultStartPositions(AlignedArray<btTransform>
float sidewards_distance, float sidewards_distance,
float upwards_distance) const float upwards_distance) const
{ {
// Node 0 is always the node on which the start line is. // In non-reverse mode: node 0 is the node on which the start line is.
int current_node = getNode(0).getPredecessor(); // 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; float distance_from_start = 0.1f+forwards_distance;