Skip to content

Commit 213d67f

Browse files
committed
BUG FIX: avoid empty route access in vehicle overlay
1 parent 19831d0 commit 213d67f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

vehicle/simvehicle.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,8 @@ void vehicle_t::display_after(int xpos, int ypos, bool is_global) const
19681968
// nothing to show
19691969
return;
19701970
}
1971-
grund_t const* const gr = cnv->get_route()?welt->lookup(cnv->get_route()->back()):NULL;
1971+
const route_t* const route = cnv->get_route();
1972+
grund_t const* const gr = route->get_count() > 0 ? welt->lookup(route->back()) : NULL;
19721973
const float conversion_ratio = (float)world()->get_settings().get_spacing_shift_divisor()/world()->ticks_per_world_month;
19731974

19741975

0 commit comments

Comments
 (0)