(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()

This commit is contained in:
smatz
2009-07-16 19:00:13 +00:00
parent b6889daf8d
commit 1f29e38b83
28 changed files with 99 additions and 90 deletions

View File

@@ -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;