(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:
@@ -1541,7 +1541,7 @@ static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int
|
||||
case ROAD_TILE_DEPOT: {
|
||||
if (v->type != VEH_ROAD) break;
|
||||
|
||||
RoadVehicle *rv = (RoadVehicle *)v;
|
||||
RoadVehicle *rv = RoadVehicle::From(v);
|
||||
if (rv->frame == RVC_DEPOT_STOP_FRAME &&
|
||||
_roadveh_enter_depot_dir[GetRoadDepotDirection(tile)] == rv->state) {
|
||||
rv->state = RVSB_IN_DEPOT;
|
||||
|
Reference in New Issue
Block a user