diff options
author | rubidium <rubidium@openttd.org> | 2010-01-07 16:39:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-07 16:39:04 +0000 |
commit | cd5516162294eff9c3439c2115a4c5754120905f (patch) | |
tree | a868d7d9c4b982ac4669949cf87a9fb4ee9f68be | |
parent | 1fc01513e2cba578138c2d733b40a4de45bc41b9 (diff) | |
download | openttd-cd5516162294eff9c3439c2115a4c5754120905f.tar.xz |
(svn r18752) -Codechange: unduplify some code
-rw-r--r-- | src/engine_gui.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 7f200bedc..9df8f8189 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -170,20 +170,17 @@ static StringID GetAircraftEngineInfoString(const Engine *e) uint16 mail_capacity; uint capacity = e->GetDisplayDefaultCapacity(&mail_capacity); + SetDParam(0, e->GetCost()); + SetDParam(1, e->GetDisplayMaxSpeed()); + SetDParam(2, cargo); + SetDParam(3, capacity); + if (mail_capacity > 0) { - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - SetDParam(2, cargo); - SetDParam(3, capacity); SetDParam(4, CT_MAIL); SetDParam(5, mail_capacity); SetDParam(6, e->GetRunningCost()); return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_CAPACITY_RUNCOST; } else { - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - SetDParam(2, cargo); - SetDParam(3, capacity); SetDParam(4, e->GetRunningCost()); return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST; } |