summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-06-27 18:26:50 +0000
committerfrosch <frosch@openttd.org>2009-06-27 18:26:50 +0000
commit812ad41f23b7ed52a161ed15b15a2af3a7edb41f (patch)
tree6758cbd7b2a75e135b4e360285445f1807d3b378 /src/town_cmd.cpp
parente42deae3a98ead62bf2ab8e76f8e571a2baa951c (diff)
downloadopenttd-812ad41f23b7ed52a161ed15b15a2af3a7edb41f.tar.xz
(svn r16676) -Codechange: Rename AcceptedCargo to CargoArray and its instances to more meaningful names.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index c51f5df38..d22527e5d 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -555,7 +555,7 @@ static CommandCost ClearTile_Town(TileIndex tile, DoCommandFlag flags)
return cost;
}
-static void AddProducedCargo_Town(TileIndex tile, AcceptedCargo ac)
+static void AddProducedCargo_Town(TileIndex tile, CargoArray produced)
{
HouseID house_id = GetHouseType(tile);
const HouseSpec *hs = HouseSpec::Get(house_id);
@@ -570,19 +570,19 @@ static void AddProducedCargo_Town(TileIndex tile, AcceptedCargo ac)
CargoID cargo = GetCargoTranslation(GB(callback, 8, 7), hs->grffile);
if (cargo == CT_INVALID) continue;
- ac[cargo]++;
+ produced[cargo]++;
}
} else {
if (hs->population > 0) {
- ac[CT_PASSENGERS]++;
+ produced[CT_PASSENGERS]++;
}
if (hs->mail_generation > 0) {
- ac[CT_MAIL]++;
+ produced[CT_MAIL]++;
}
}
}
-static void AddAcceptedCargo_Town(TileIndex tile, AcceptedCargo ac)
+static void AddAcceptedCargo_Town(TileIndex tile, CargoArray acceptance)
{
const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile));
CargoID accepts[3];
@@ -607,13 +607,13 @@ static void AddAcceptedCargo_Town(TileIndex tile, AcceptedCargo ac)
if (HasBit(hs->callback_mask, CBM_HOUSE_CARGO_ACCEPTANCE)) {
uint16 callback = GetHouseCallback(CBID_HOUSE_CARGO_ACCEPTANCE, 0, 0, GetHouseType(tile), Town::GetByTile(tile), tile);
if (callback != CALLBACK_FAILED) {
- if (accepts[0] != CT_INVALID) ac[accepts[0]] += GB(callback, 0, 4);
- if (accepts[1] != CT_INVALID) ac[accepts[1]] += GB(callback, 4, 4);
+ if (accepts[0] != CT_INVALID) acceptance[accepts[0]] += GB(callback, 0, 4);
+ if (accepts[1] != CT_INVALID) acceptance[accepts[1]] += GB(callback, 4, 4);
if (_settings_game.game_creation.landscape != LT_TEMPERATE && HasBit(callback, 12)) {
/* The 'S' bit indicates food instead of goods */
- ac[CT_FOOD] += GB(callback, 8, 4);
+ acceptance[CT_FOOD] += GB(callback, 8, 4);
} else {
- if (accepts[2] != CT_INVALID) ac[accepts[2]] += GB(callback, 8, 4);
+ if (accepts[2] != CT_INVALID) acceptance[accepts[2]] += GB(callback, 8, 4);
}
return;
}
@@ -621,7 +621,7 @@ static void AddAcceptedCargo_Town(TileIndex tile, AcceptedCargo ac)
/* No custom acceptance, so fill in with the default values */
for (uint8 i = 0; i < lengthof(accepts); i++) {
- if (accepts[i] != CT_INVALID) ac[accepts[i]] += hs->cargo_acceptance[i];
+ if (accepts[i] != CT_INVALID) acceptance[accepts[i]] += hs->cargo_acceptance[i];
}
}