(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:
@@ -912,9 +912,9 @@ bool AfterLoadGame()
|
||||
continue;
|
||||
}
|
||||
if (v->type == VEH_TRAIN) {
|
||||
((Train *)v)->track = TRACK_BIT_WORMHOLE;
|
||||
Train::From(v)->track = TRACK_BIT_WORMHOLE;
|
||||
} else {
|
||||
((RoadVehicle *)v)->state = RVSB_WORMHOLE;
|
||||
RoadVehicle::From(v)->state = RVSB_WORMHOLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user