From f18043ee21218dc9ea26ce41b1294c5212ac363c Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 26 Dec 2008 20:45:02 +0000 Subject: (svn r14747) -Codechange: remove DeleteVehicleChain in favour of the vehicle destructor as that was already doing the same for a few vehicle types. --- src/train_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 50f50b137..619a3e8a4 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -938,6 +938,7 @@ static Vehicle *UnlinkWagon(Vehicle *v, Vehicle *first) if (v == NULL) return NULL; if (IsTrainWagon(v)) SetFreeWagon(v); + first->SetNext(NULL); return v; } @@ -4392,7 +4393,7 @@ void Train::Tick() TrainLocoHandler(this, true); } else if (IsFreeWagon(this) && HASBITS(this->vehstatus, VS_CRASHED)) { /* Delete flooded standalone wagon chain */ - if (++this->u.rail.crash_anim_pos >= 4400) DeleteVehicleChain(this); + if (++this->u.rail.crash_anim_pos >= 4400) delete this; } } -- cgit v1.2.3-70-g09d2