diff options
author | rubidium <rubidium@openttd.org> | 2008-12-26 20:45:02 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-26 20:45:02 +0000 |
commit | c34ce32f261fb145af2d2153f0e694ac7a99a80c (patch) | |
tree | 8f057180fb9ab731f9c1950f45a7d957bf7d4ae0 /src/train_cmd.cpp | |
parent | 7fbd5beb0f92c6f53b4b8d9206773003328b2e7d (diff) | |
download | openttd-c34ce32f261fb145af2d2153f0e694ac7a99a80c.tar.xz |
(svn r14747) -Codechange: remove DeleteVehicleChain in favour of the vehicle destructor as that was already doing the same for a few vehicle types.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; } } |