summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-16 19:00:13 +0000
committersmatz <smatz@openttd.org>2009-07-16 19:00:13 +0000
commit1f29e38b8372484d51d852b89fc957eb53635ecb (patch)
treeda4a251ac74e87e72a2857233069790f991914f6 /src/newgrf_engine.cpp
parentb6889daf8d11b083358a26eea3f633942e2e50e4 (diff)
downloadopenttd-1f29e38b8372484d51d852b89fc957eb53635ecb.tar.xz
(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index df2622941..677b196f1 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -493,7 +493,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
const Engine *e = Engine::Get(object->u.vehicle.self_type);
CargoID cargo_type = e->GetDefaultCargoType();
if (cargo_type != CT_INVALID) {
- const CargoSpec *cs = GetCargo(cargo_type);
+ const CargoSpec *cs = CargoSpec::Get(cargo_type);
return (cs->classes << 16) | (cs->weight << 8) | GetEngineGRF(e->index)->cargo_map[cargo_type];
} else {
return 0x000000FF;
@@ -549,7 +549,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
/* Skip empty engines */
if (u->cargo_cap == 0) continue;
- cargo_classes |= GetCargo(u->cargo_type)->classes;
+ cargo_classes |= CargoSpec::Get(u->cargo_type)->classes;
common_cargos[u->cargo_type]++;
}
@@ -579,7 +579,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
}
}
- uint8 common_bitnum = (common_cargo_type == CT_INVALID ? 0xFF : GetCargo(common_cargo_type)->bitnum);
+ uint8 common_bitnum = (common_cargo_type == CT_INVALID ? 0xFF : CargoSpec::Get(common_cargo_type)->bitnum);
v->vcache.cached_var42 = cargo_classes | (common_bitnum << 8) | (common_subtype << 16) | (user_def_data << 24);
SetBit(v->vcache.cache_valid, 2);
}
@@ -652,7 +652,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
* ww - cargo unit weight in 1/16 tons, same as cargo prop. 0F.
* cccc - the cargo class value of the cargo transported by the vehicle.
*/
- const CargoSpec *cs = GetCargo(v->cargo_type);
+ const CargoSpec *cs = CargoSpec::Get(v->cargo_type);
return (cs->classes << 16) | (cs->weight << 8) | GetEngineGRF(v->engine_type)->cargo_map[v->cargo_type];
}