mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r12258) -Fix: GetProductionAroundTiles() may fail if only the second production slot exists
This commit is contained in:
parent
ff7e789f83
commit
a857d32676
@ -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]]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user