mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 07:21:53 +00:00
(svn r23334) -Fix [FS#4820]: Road vehicle purchase info failed to display vehicles carrying no cargo. (Can only happen when NewGRFs are screwed up.)
This commit is contained in:
parent
349da42ce3
commit
3e780a794b
@ -629,7 +629,7 @@ static int DrawRoadVehPurchaseInfo(int left, int right, int y, EngineID engine_n
|
|||||||
/* Road vehicle weight - (including cargo) */
|
/* Road vehicle weight - (including cargo) */
|
||||||
int16 weight = e->GetDisplayWeight();
|
int16 weight = e->GetDisplayWeight();
|
||||||
SetDParam(0, weight);
|
SetDParam(0, weight);
|
||||||
uint cargo_weight = CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16;
|
uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(e->GetDefaultCargoType())->weight * GetTotalCapacityOfArticulatedParts(engine_number) / 16 : 0);
|
||||||
SetDParam(1, cargo_weight + weight);
|
SetDParam(1, cargo_weight + weight);
|
||||||
DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT);
|
DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT);
|
||||||
y += FONT_HEIGHT_NORMAL;
|
y += FONT_HEIGHT_NORMAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user