Codechange: Use new function to get a bitmask of empty cargo types.

This commit is contained in:
Peter Nelson
2023-09-21 08:38:46 +01:00
committed by PeterN
parent 69ee38bd43
commit 398c7e5f9d
4 changed files with 20 additions and 18 deletions

View File

@@ -385,15 +385,8 @@ void TriggerRoadStopRandomisation(Station *st, TileIndex tile, RoadStopRandomTri
uint32_t whole_reseed = 0;
CargoTypes empty_mask = 0;
if (trigger == RSRT_CARGO_TAKEN) {
/* Create a bitmask of completely empty cargo types to be matched */
for (CargoID i = 0; i < NUM_CARGO; i++) {
if (st->goods[i].cargo.TotalCount() == 0) {
SetBit(empty_mask, i);
}
}
}
/* Bitmask of completely empty cargo types to be matched. */
CargoTypes empty_mask = (trigger == RSRT_CARGO_TAKEN) ? GetEmptyMask(st) : 0;
uint32_t used_triggers = 0;
auto process_tile = [&](TileIndex cur_tile) {