summaryrefslogtreecommitdiff
path: root/src/engine_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-10-06 19:17:07 +0000
committerfrosch <frosch@openttd.org>2009-10-06 19:17:07 +0000
commitf3aacb8fe3e96efd90b0ab93dbf8fb33a8842434 (patch)
tree373048e110915c31097d4e056da5f54833620492 /src/engine_gui.cpp
parent95dfee1c604d420df9f0d5860fcddf29e657fc32 (diff)
downloadopenttd-f3aacb8fe3e96efd90b0ab93dbf8fb33a8842434.tar.xz
(svn r17725) -Codechange: Reduce usage of EngInfo and XxxVehInfo, esp. when a Engine * is already present.
Diffstat (limited to 'src/engine_gui.cpp')
-rw-r--r--src/engine_gui.cpp5
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;
}
}