mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-03 03:49:12 +00:00
(svn r18752) -Codechange: unduplify some code
This commit is contained in:
@@ -170,20 +170,17 @@ static StringID GetAircraftEngineInfoString(const Engine *e)
|
|||||||
uint16 mail_capacity;
|
uint16 mail_capacity;
|
||||||
uint capacity = e->GetDisplayDefaultCapacity(&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) {
|
if (mail_capacity > 0) {
|
||||||
SetDParam(0, e->GetCost());
|
|
||||||
SetDParam(1, e->GetDisplayMaxSpeed());
|
|
||||||
SetDParam(2, cargo);
|
|
||||||
SetDParam(3, capacity);
|
|
||||||
SetDParam(4, CT_MAIL);
|
SetDParam(4, CT_MAIL);
|
||||||
SetDParam(5, mail_capacity);
|
SetDParam(5, mail_capacity);
|
||||||
SetDParam(6, e->GetRunningCost());
|
SetDParam(6, e->GetRunningCost());
|
||||||
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_CAPACITY_RUNCOST;
|
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_CAPACITY_RUNCOST;
|
||||||
} else {
|
} else {
|
||||||
SetDParam(0, e->GetCost());
|
|
||||||
SetDParam(1, e->GetDisplayMaxSpeed());
|
|
||||||
SetDParam(2, cargo);
|
|
||||||
SetDParam(3, capacity);
|
|
||||||
SetDParam(4, e->GetRunningCost());
|
SetDParam(4, e->GetRunningCost());
|
||||||
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST;
|
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user