Changeset - r6788:de0011fb87a3
[Not reviewed]
master
0 1 0
bjarni - 17 years ago 2007-06-02 17:23:31
bjarni@openttd.org
(svn r10026) -Fix: unlinking a rail vehicle didn't clear the first pointer
After r9973, this could cause some asserts as some vehicles could end up with first pointers to chains they didn't belong to
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -839,6 +839,7 @@ static Vehicle *UnlinkWagon(Vehicle *v, 
 
	Vehicle *u;
 
	for (u = first; GetNextVehicle(u) != v; u = GetNextVehicle(u)) {}
 
	GetLastEnginePart(u)->next = GetNextVehicle(v);
 
	v->first = NULL; // we shouldn't point to the old first, since the vehicle isn't in that chain anymore
 
	return first;
 
}
 

	
0 comments (0 inline, 0 general)