forked from mirror/OpenTTD
(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()
This commit is contained in:
@@ -445,7 +445,7 @@ static int DrawRailWagonPurchaseInfo(int left, int right, int y, EngineID engine
|
||||
/* Wagon weight - (including cargo) */
|
||||
uint weight = e->GetDisplayWeight();
|
||||
SetDParam(0, weight);
|
||||
uint cargo_weight = (e->CanCarryCargo() ? GetCargo(e->GetDefaultCargoType())->weight * e->GetDisplayDefaultCapacity() >> 4 : 0);
|
||||
uint cargo_weight = (e->CanCarryCargo() ? CargoSpec::Get(e->GetDefaultCargoType())->weight * e->GetDisplayDefaultCapacity() >> 4 : 0);
|
||||
SetDParam(1, cargo_weight + weight);
|
||||
DrawString(left, right, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT);
|
||||
y += FONT_HEIGHT_NORMAL;
|
||||
@@ -821,7 +821,7 @@ struct BuildVehicleWindow : Window {
|
||||
|
||||
/* Collect available cargo types for filtering */
|
||||
for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
|
||||
const CargoSpec *cargo = GetCargo(cid);
|
||||
const CargoSpec *cargo = CargoSpec::Get(cid);
|
||||
if (!cargo->IsValid()) continue;
|
||||
if (IsCargoInClass(cid, CC_SPECIAL)) continue; // exclude fake cargo types
|
||||
this->cargo_filter[filter_items] = cid;
|
||||
|
Reference in New Issue
Block a user