From e129438139f2e427b9d0d57065099a2aaea8db50 Mon Sep 17 00:00:00 2001 From: bjarni Date: Sat, 2 Jun 2007 17:23:31 +0000 Subject: (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 --- src/train_cmd.cpp | 1 + 1 file changed, 1 insertion(+) 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; } -- cgit v1.2.3-70-g09d2