diff options
-rw-r--r-- | src/station_cmd.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 995064f5b..c7c0ec537 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -474,11 +474,8 @@ void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, CargoID cargos[2] = { CT_INVALID, CT_INVALID }; gpc(tile, cargos); - if (cargos[0] != CT_INVALID) { - produced[cargos[0]]++; - if (cargos[1] != CT_INVALID) { - produced[cargos[1]]++; - } + for (uint i = 0; i < lengthof(cargos); ++i) { + if (cargos[i] != CT_INVALID) produced[cargos[i]]++; } } } |