(svn r16527) -Codechange: use static member functions instead of simple casts when converting Vehicle to specialised vehicle types. Includes safety check

This commit is contained in:
smatz
2009-06-06 16:54:22 +00:00
parent c90819ff6d
commit 0c10006907
36 changed files with 185 additions and 161 deletions

View File

@@ -235,7 +235,7 @@ static Vehicle *FindTrainOnTrackEnum(Vehicle *v, void *data)
if (v->type != VEH_TRAIN || (v->vehstatus & VS_CRASHED)) return NULL;
Train *t = (Train *)v;
Train *t = Train::From(v);
if (HasBit((TrackBits)t->track, TrackdirToTrack(info->res.trackdir))) {
t = t->First();