diff options
author | frosch <frosch@openttd.org> | 2012-03-24 15:21:07 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-03-24 15:21:07 +0000 |
commit | 77ff4c91550500e93e85e2e1198d6eb600295264 (patch) | |
tree | 279b49b5c492fa47515829c028395e6086aff046 /src/engine_gui.cpp | |
parent | a0b258ef124ce5660c0065dee3742a797caf6d2b (diff) | |
download | openttd-77ff4c91550500e93e85e2e1198d6eb600295264.tar.xz |
(svn r24058) -Fix [FS#5124]: Wrong numbering of string parameters.
Diffstat (limited to 'src/engine_gui.cpp')
-rw-r--r-- | src/engine_gui.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 61b5e25d8..bac56dce6 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -166,19 +166,20 @@ static StringID GetAircraftEngineInfoString(const Engine *e) uint capacity = e->GetDisplayDefaultCapacity(&mail_capacity); uint16 range = e->GetRange(); - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - SetDParam(2, cargo); - SetDParam(3, capacity); - SetDParam(7, range); + uint i = 0; + SetDParam(i++, e->GetCost()); + SetDParam(i++, e->GetDisplayMaxSpeed()); + if (range > 0) SetDParam(i++, range); + SetDParam(i++, cargo); + SetDParam(i++, capacity); if (mail_capacity > 0) { - SetDParam(4, CT_MAIL); - SetDParam(5, mail_capacity); - SetDParam(6, e->GetRunningCost()); + SetDParam(i++, CT_MAIL); + SetDParam(i++, mail_capacity); + SetDParam(i++, e->GetRunningCost()); return range > 0 ? STR_ENGINE_PREVIEW_COST_MAX_SPEED_RANGE_CAPACITY_CAPACITY_RUNCOST : STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_CAPACITY_RUNCOST; } else { - SetDParam(4, e->GetRunningCost()); + SetDParam(i++, e->GetRunningCost()); return range > 0 ? STR_ENGINE_PREVIEW_COST_MAX_SPEED_RANGE_CAPACITY_RUNCOST : STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST; } } |