mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +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 };
|
CargoID cargos[2] = { CT_INVALID, CT_INVALID };
|
||||||
|
|
||||||
gpc(tile, cargos);
|
gpc(tile, cargos);
|
||||||
if (cargos[0] != CT_INVALID) {
|
for (uint i = 0; i < lengthof(cargos); ++i) {
|
||||||
produced[cargos[0]]++;
|
if (cargos[i] != CT_INVALID) produced[cargos[i]]++;
|
||||||
if (cargos[1] != CT_INVALID) {
|
|
||||||
produced[cargos[1]]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user