summaryrefslogtreecommitdiff
path: root/src/roadveh_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_gui.cpp')
-rw-r--r--src/roadveh_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index 09ebd1fc9..19f6cec82 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -130,7 +130,7 @@ void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection, int c
int highlight_w = 0;
for (int dx = 0; v != NULL && dx < max_length ; v = v->Next()) {
- int width = ((const RoadVehicle *)v)->rcache.cached_veh_length;
+ int width = RoadVehicle::From(v)->rcache.cached_veh_length;
if (dx + width > 0 && dx <= max_length) {
SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);