diff options
Diffstat (limited to 'src/engine_gui.cpp')
-rw-r--r-- | src/engine_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 15df2de24..43125c4d4 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -30,13 +30,14 @@ */ StringID GetEngineCategoryName(EngineID engine) { - switch (Engine::Get(engine)->type) { + const Engine *e = Engine::Get(engine); + switch (e->type) { default: NOT_REACHED(); case VEH_ROAD: return STR_ENGINE_PREVIEW_ROAD_VEHICLE; case VEH_AIRCRAFT: return STR_ENGINE_PREVIEW_AIRCRAFT; case VEH_SHIP: return STR_ENGINE_PREVIEW_SHIP; case VEH_TRAIN: - return GetRailTypeInfo(RailVehInfo(engine)->railtype)->strings.new_loco; + return GetRailTypeInfo(e->u.rail.railtype)->strings.new_loco; } } |