diff options
author | PeterN <peter@fuzzle.org> | 2018-05-21 22:08:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 22:08:39 +0100 |
commit | 4cebebcf683b079ff010e70b0a0a78c12734933e (patch) | |
tree | 4f140272bd8c1efba4916a642b85a22f153cb7b4 /src/town_cmd.cpp | |
parent | 42b43c998314a3fcd89aa59ad7834104dd80b053 (diff) | |
download | openttd-4cebebcf683b079ff010e70b0a0a78c12734933e.tar.xz |
Change: Add CargoTypes type for cargo masks. (#6790)
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 0001de00d..0575b0a37 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -53,7 +53,7 @@ #include "safeguards.h" TownID _new_town_id; -uint32 _town_cargoes_accepted; ///< Bitmap of all cargoes accepted by houses. +CargoTypes _town_cargoes_accepted; ///< Bitmap of all cargoes accepted by houses. /* Initialize the town-pool */ TownPool _town_pool("Town"); @@ -601,14 +601,14 @@ static void AddProducedCargo_Town(TileIndex tile, CargoArray &produced) } } -static inline void AddAcceptedCargoSetMask(CargoID cargo, uint amount, CargoArray &acceptance, uint32 *always_accepted) +static inline void AddAcceptedCargoSetMask(CargoID cargo, uint amount, CargoArray &acceptance, CargoTypes *always_accepted) { if (cargo == CT_INVALID || amount == 0) return; acceptance[cargo] += amount; SetBit(*always_accepted, cargo); } -static void AddAcceptedCargo_Town(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted) +static void AddAcceptedCargo_Town(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted) { const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile)); CargoID accepts[3]; @@ -719,7 +719,7 @@ void UpdateTownCargoTotal(Town *t) static void UpdateTownCargoes(Town *t, TileIndex start, bool update_total = true) { CargoArray accepted, produced; - uint32 dummy; + CargoTypes dummy; /* Gather acceptance for all houses in an area around the start tile. * The area is composed of the square the tile is in, extended one square in all @@ -733,7 +733,7 @@ static void UpdateTownCargoes(Town *t, TileIndex start, bool update_total = true } /* Create bitmap of produced and accepted cargoes. */ - uint32 acc = 0; + CargoTypes acc = 0; for (uint cid = 0; cid < NUM_CARGO; cid++) { if (accepted[cid] >= 8) SetBit(acc, cid); if (produced[cid] > 0) SetBit(t->cargo_produced, cid); |