summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-06-02 17:23:31 +0000
committerbjarni <bjarni@openttd.org>2007-06-02 17:23:31 +0000
commit9f13fc2cf59938ef04f5309986c9e48fd71ec6ad (patch)
tree1e09459524ba97d1816cd9ca9d83e691fc4ad08f /src/train_cmd.cpp
parent07e7a80a05f60fc691114ab27539e1bec4ab3676 (diff)
downloadopenttd-9f13fc2cf59938ef04f5309986c9e48fd71ec6ad.tar.xz
(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
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 4c7bf90cf..2c300c190 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -839,6 +839,7 @@ static Vehicle *UnlinkWagon(Vehicle *v, Vehicle *first)
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;
}