forked from mirror/OpenTTD
Codechange: Factor cargotype weight conversion magic numbers
This commit is contained in:
committed by
Michael Lutz
parent
019dcb7b7b
commit
89cf0d5da8
@@ -123,6 +123,13 @@ struct CargoSpec {
|
||||
|
||||
SpriteID GetCargoIcon() const;
|
||||
|
||||
inline uint64 WeightOfNUnits(uint32 n) const
|
||||
{
|
||||
return n * this->weight / 16u;
|
||||
}
|
||||
|
||||
uint64 WeightOfNUnitsInTrain(uint32 n) const;
|
||||
|
||||
/**
|
||||
* Iterator to iterate all valid CargoSpec
|
||||
*/
|
||||
|
Reference in New Issue
Block a user