diff options
author | smatz <smatz@openttd.org> | 2009-07-16 19:00:13 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-07-16 19:00:13 +0000 |
commit | 1f29e38b8372484d51d852b89fc957eb53635ecb (patch) | |
tree | da4a251ac74e87e72a2857233069790f991914f6 /src/ai/api | |
parent | b6889daf8d11b083358a26eea3f633942e2e50e4 (diff) | |
download | openttd-1f29e38b8372484d51d852b89fc957eb53635ecb.tar.xz |
(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()
Diffstat (limited to 'src/ai/api')
-rw-r--r-- | src/ai/api/ai_cargo.cpp | 8 | ||||
-rw-r--r-- | src/ai/api/ai_cargolist.cpp | 2 | ||||
-rw-r--r-- | src/ai/api/ai_subsidy.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/ai/api/ai_cargo.cpp b/src/ai/api/ai_cargo.cpp index 1e2684f1a..4b1593d26 100644 --- a/src/ai/api/ai_cargo.cpp +++ b/src/ai/api/ai_cargo.cpp @@ -11,13 +11,13 @@ /* static */ bool AICargo::IsValidCargo(CargoID cargo_type) { - return (cargo_type < NUM_CARGO && ::GetCargo(cargo_type)->IsValid()); + return (cargo_type < NUM_CARGO && ::CargoSpec::Get(cargo_type)->IsValid()); } /* static */ char *AICargo::GetCargoLabel(CargoID cargo_type) { if (!IsValidCargo(cargo_type)) return NULL; - const CargoSpec *cargo = ::GetCargo(cargo_type); + const CargoSpec *cargo = ::CargoSpec::Get(cargo_type); /* cargo->label is a uint32 packing a 4 character non-terminated string, * like "PASS", "COAL", "OIL_". New ones can be defined by NewGRFs */ @@ -32,7 +32,7 @@ /* static */ bool AICargo::IsFreight(CargoID cargo_type) { if (!IsValidCargo(cargo_type)) return false; - const CargoSpec *cargo = ::GetCargo(cargo_type); + const CargoSpec *cargo = ::CargoSpec::Get(cargo_type); return cargo->is_freight; } @@ -46,7 +46,7 @@ { if (!IsValidCargo(cargo_type)) return TE_NONE; - return (AICargo::TownEffect)GetCargo(cargo_type)->town_effect; + return (AICargo::TownEffect)CargoSpec::Get(cargo_type)->town_effect; } /* static */ Money AICargo::GetCargoIncome(CargoID cargo_type, uint32 distance, uint32 days_in_transit) diff --git a/src/ai/api/ai_cargolist.cpp b/src/ai/api/ai_cargolist.cpp index d35e54e30..ebf664dee 100644 --- a/src/ai/api/ai_cargolist.cpp +++ b/src/ai/api/ai_cargolist.cpp @@ -11,7 +11,7 @@ AICargoList::AICargoList() { for (byte i = 0; i < NUM_CARGO; i++) { - const CargoSpec *c = ::GetCargo(i); + const CargoSpec *c = ::CargoSpec::Get(i); if (c->IsValid()) { this->AddItem(i); } diff --git a/src/ai/api/ai_subsidy.cpp b/src/ai/api/ai_subsidy.cpp index 839654e43..de7616367 100644 --- a/src/ai/api/ai_subsidy.cpp +++ b/src/ai/api/ai_subsidy.cpp @@ -57,8 +57,8 @@ { if (!IsValidSubsidy(subsidy_id) || IsAwarded(subsidy_id)) return false; - return GetCargo(GetCargoType(subsidy_id))->town_effect == TE_PASSENGERS || - GetCargo(GetCargoType(subsidy_id))->town_effect == TE_MAIL; + return CargoSpec::Get(GetCargoType(subsidy_id))->town_effect == TE_PASSENGERS || + CargoSpec::Get(GetCargoType(subsidy_id))->town_effect == TE_MAIL; } /* static */ int32 AISubsidy::GetSource(SubsidyID subsidy_id) @@ -72,7 +72,7 @@ { if (!IsValidSubsidy(subsidy_id) || IsAwarded(subsidy_id)) return false; - switch (GetCargo(GetCargoType(subsidy_id))->town_effect) { + switch (CargoSpec::Get(GetCargoType(subsidy_id))->town_effect) { case TE_PASSENGERS: case TE_MAIL: case TE_GOODS: |