Codechange: Factor cargotype weight conversion magic numbers
This commit is contained in:

committed by
Michael Lutz

parent
019dcb7b7b
commit
89cf0d5da8
@@ -85,5 +85,5 @@
|
||||
/* static */ int64 ScriptCargo::GetWeight(CargoID cargo_type, uint32 amount)
|
||||
{
|
||||
if (!IsValidCargo(cargo_type)) return -1;
|
||||
return ::CargoSpec::Get(cargo_type)->weight * static_cast<int64>(amount) / 16;
|
||||
return ::CargoSpec::Get(cargo_type)->WeightOfNUnits(amount);
|
||||
}
|
||||
|
Reference in New Issue
Block a user