diff options
author | glx <glx@openttd.org> | 2008-02-25 16:30:12 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-02-25 16:30:12 +0000 |
commit | a857d326769e3fccdfc684627f72807b7b5a71f2 (patch) | |
tree | 0199c66ebc6adc3885a21abcd36de9d4b703aa32 /src | |
parent | ff7e789f83ccd0d2caf71e54b73f290fdb6f2f0b (diff) | |
download | openttd-a857d326769e3fccdfc684627f72807b7b5a71f2.tar.xz |
(svn r12258) -Fix: GetProductionAroundTiles() may fail if only the second production slot exists
Diffstat (limited to 'src')
-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]]++; } } } |