(svn r12258) -Fix: GetProductionAroundTiles() may fail if only the second production slot exists

This commit is contained in:
glx 2008-02-25 16:30:12 +00:00
parent ff7e789f83
commit a857d32676

View File

@ -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]]++;
}
}
}