(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:
rubidium
2008-12-26 20:45:02 +00:00
parent 73ca72922c
commit f18043ee21
6 changed files with 14 additions and 53 deletions

View File

@@ -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;
}
}