(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

@@ -833,7 +833,7 @@ void ResetEconomy()
bool needed = false;
for (CargoID c = 0; c < NUM_CARGO; c++) {
const CargoSpec *cs = GetCargo(c);
const CargoSpec *cs = CargoSpec::Get(c);
if (!cs->IsValid()) continue;
if (_cargo_payment_rates[c] == 0) {
needed = true;
@@ -866,7 +866,7 @@ Money GetPriceByIndex(uint8 index)
Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type)
{
const CargoSpec *cs = GetCargo(cargo_type);
const CargoSpec *cs = CargoSpec::Get(cargo_type);
/* Use callback to calculate cargo profit, if available */
if (HasBit(cs->callback_mask, CBM_CARGO_PROFIT_CALC)) {
@@ -1089,7 +1089,7 @@ static Money DeliverGoods(int num_pieces, CargoID cargo_type, StationID source,
}
/* Increase town's counter for some special goods types */
const CargoSpec *cs = GetCargo(cargo_type);
const CargoSpec *cs = CargoSpec::Get(cargo_type);
if (cs->town_effect == TE_FOOD) s_to->town->new_act_food += num_pieces;
if (cs->town_effect == TE_WATER) s_to->town->new_act_water += num_pieces;