(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

@@ -179,8 +179,7 @@
{
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
CargoArray acceptance;
::GetAcceptanceAroundTiles(acceptance, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
CargoArray acceptance = ::GetAcceptanceAroundTiles(tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
return acceptance[cargo_type];
}
@@ -188,8 +187,7 @@
{
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
CargoArray produced;
::GetProductionAroundTiles(produced, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
CargoArray produced = ::GetProductionAroundTiles(tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
return produced[cargo_type];
}