diff options
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 30b606bc3..231abebe8 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1547,20 +1547,22 @@ static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int } break; - case ROAD_TILE_DEPOT: - if (v->type == VEH_ROAD && - v->u.road.frame == RVC_DEPOT_STOP_FRAME && - _roadveh_enter_depot_dir[GetRoadDepotDirection(tile)] == v->u.road.state) { - v->u.road.state = RVSB_IN_DEPOT; - v->vehstatus |= VS_HIDDEN; - v->direction = ReverseDir(v->direction); - if (v->Next() == NULL) VehicleEnterDepot(v); - v->tile = tile; - - InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); + case ROAD_TILE_DEPOT: { + if (v->type != VEH_ROAD) break; + + RoadVehicle *rv = (RoadVehicle *)v; + if (rv->frame == RVC_DEPOT_STOP_FRAME && + _roadveh_enter_depot_dir[GetRoadDepotDirection(tile)] == rv->state) { + rv->state = RVSB_IN_DEPOT; + rv->vehstatus |= VS_HIDDEN; + rv->direction = ReverseDir(rv->direction); + if (rv->Next() == NULL) VehicleEnterDepot(rv); + rv->tile = tile; + + InvalidateWindowData(WC_VEHICLE_DEPOT, rv->tile); return VETSB_ENTERED_WORMHOLE; } - break; + } break; default: break; } |