(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

@@ -76,7 +76,7 @@ static inline DiagDirection TrainExitDir(Direction direction, TrackBits track)
*/
byte FreightWagonMult(CargoID cargo)
{
if (!GetCargo(cargo)->is_freight) return 1;
if (!CargoSpec::Get(cargo)->is_freight) return 1;
return _settings_game.vehicle.freight_trains;
}
@@ -139,7 +139,7 @@ static void TrainCargoChanged(Train *v)
uint32 weight = 0;
for (Train *u = v; u != NULL; u = u->Next()) {
uint32 vweight = GetCargo(u->cargo_type)->weight * u->cargo.Count() * FreightWagonMult(u->cargo_type) / 16;
uint32 vweight = CargoSpec::Get(u->cargo_type)->weight * u->cargo.Count() * FreightWagonMult(u->cargo_type) / 16;
/* Vehicle weight is not added for articulated parts. */
if (!u->IsArticulatedPart()) {