Mercurial > hg > openttd
changeset 6788:19c1341e885a draft
(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
author | bjarni <bjarni@openttd.org> |
---|---|
date | Sat, 02 Jun 2007 17:23:31 +0000 |
parents | 5e31236c9275 |
children | 26a3c3985d67 |
files | src/train_cmd.cpp |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -839,6 +839,7 @@ 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; }