diff options
Diffstat (limited to 'src/cargotype.cpp')
-rw-r--r-- | src/cargotype.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cargotype.cpp b/src/cargotype.cpp index 04e29ac1f..6d601e255 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -23,12 +23,17 @@ CargoSpec CargoSpec::array[NUM_CARGO]; /** - * Bitmask of cargo types available. + * Bitmask of cargo types available. This includes phony cargoes like regearing cargoes. * Initialized during a call to #SetupCargoForClimate. */ uint32 _cargo_mask; /** + * Bitmask of real cargo types available. Phony cargoes like regearing cargoes are excluded. + */ +uint32 _standard_cargo_mask; + +/** * Set up the default cargo types for the given landscape type. * @param l Landscape */ @@ -176,10 +181,13 @@ void InitializeSortedCargoSpecs() /* Sort cargo specifications by cargo class and name. */ QSortT(_sorted_cargo_specs, _sorted_cargo_specs_size, &CargoSpecClassSorter); + _standard_cargo_mask = 0; + _sorted_standard_cargo_specs_size = 0; FOR_ALL_SORTED_CARGOSPECS(cargo) { if (cargo->classes & CC_SPECIAL) break; _sorted_standard_cargo_specs_size++; + SetBit(_standard_cargo_mask, cargo->Index()); } } |