Use CargoID instead of CargoSpec in town_production_cargoes

This commit is contained in:
Jonathan G Rennison
2024-02-19 04:02:24 +00:00
parent 19e4895ffd
commit 6ab1f9a416
3 changed files with 4 additions and 5 deletions

View File

@@ -24,7 +24,7 @@
#include "safeguards.h"
CargoSpec CargoSpec::array[NUM_CARGO];
std::array<std::vector<const CargoSpec *>, NUM_TPE> CargoSpec::town_production_cargoes{};
std::array<std::vector<CargoID>, NUM_TPE> CargoSpec::town_production_cargoes{};
std::array<CargoTypes, NUM_TPE> CargoSpec::town_production_cargo_mask{};
/**
@@ -237,7 +237,7 @@ void InitializeSortedCargoSpecs()
uint8_t nb_standard_cargo = 0;
for (const auto &cargo : _sorted_cargo_specs) {
assert(cargo->town_production_effect != INVALID_TPE);
CargoSpec::town_production_cargoes[cargo->town_production_effect].push_back(cargo);
CargoSpec::town_production_cargoes[cargo->town_production_effect].push_back(cargo->Index());
SetBit(CargoSpec::town_production_cargo_mask[cargo->town_production_effect], cargo->Index());
if (cargo->classes & CC_SPECIAL) break;
nb_standard_cargo++;