(svn r16678) -Codechange: Turn CargoArray into a class, so one does not have to deal with sizeof() wrt. typedef-ed arrays.

This commit is contained in:
frosch
2009-06-27 21:06:58 +00:00
parent 9b070b5405
commit a288e4d82f
14 changed files with 59 additions and 53 deletions

View File

@@ -92,8 +92,7 @@ AITileList_IndustryAccepting::AITileList_IndustryAccepting(IndustryID industry_i
/* Only add the tile if it accepts the cargo (sometimes just 1 tile of an
* industry triggers the acceptance). */
CargoArray acceptance;
::GetAcceptanceAroundTiles(acceptance, cur_tile, 1, 1, radius);
CargoArray acceptance = ::GetAcceptanceAroundTiles(cur_tile, 1, 1, radius);
{
bool cargo_accepts = false;
for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
@@ -130,8 +129,7 @@ AITileList_IndustryProducing::AITileList_IndustryProducing(IndustryID industry_i
/* Only add the tile if it produces the cargo (a bug in OpenTTD makes this
* inconsitance). */
CargoArray produced;
::GetProductionAroundTiles(produced, cur_tile, 1, 1, radius);
CargoArray produced = ::GetProductionAroundTiles(cur_tile, 1, 1, radius);
{
bool cargo_produces = false;
for (byte j = 0; j < lengthof(i->produced_cargo); j++) {