(svn r14747) -Codechange: remove DeleteVehicleChain in favour of the vehicle destructor as that was already doing the same for a few vehicle types.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user