Bugfix: distance-from-start calculations could become inconsistent at places where two drivelines
merge together, resulting in kart-order changing more or less randomly. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4272 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -85,9 +85,14 @@ void GraphNode::addSuccessor(unsigned int to)
|
||||
// The distance from start for the successor node
|
||||
if(to!=0)
|
||||
{
|
||||
m_all_nodes->getNode(to).m_distance_from_start =
|
||||
std::max(m_all_nodes->getNode(to).m_distance_from_start,
|
||||
m_distance_from_start+distance_to_next);
|
||||
// Do not change an existing, already set distance on another
|
||||
// node (since this would mean that we then have to change all
|
||||
// other nodes following that node, too).
|
||||
if(m_all_nodes->getNode(to).m_distance_from_start==0)
|
||||
{
|
||||
m_all_nodes->getNode(to).m_distance_from_start =
|
||||
m_distance_from_start+distance_to_next;
|
||||
}
|
||||
}
|
||||
} // addSuccessor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user