summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-03-26 22:23:32 +0000
committerDarkvater <darkvater@openttd.org>2006-03-26 22:23:32 +0000
commitd5909f901a8558dbfc562c75a387d66251c6ed20 (patch)
tree2a31936844a550db9aea12a9b2645bfd4e7e7fa2 /economy.c
parent76f1609ee165bfe66a5250144ced8654e28e36ff (diff)
downloadopenttd-d5909f901a8558dbfc562c75a387d66251c6ed20.tar.xz
(svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type.
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/economy.c b/economy.c
index f957eb687..86aebd70e 100644
--- a/economy.c
+++ b/economy.c
@@ -908,7 +908,7 @@ void DeleteSubsidyWithStation(uint16 index)
typedef struct FoundRoute {
uint distance;
- byte cargo;
+ CargoID cargo;
void *from;
void *to;
} FoundRoute;
@@ -934,7 +934,7 @@ static void FindSubsidyCargoRoute(FoundRoute *fr)
{
Industry *i;
int trans, total;
- byte cargo;
+ CargoID cargo;
fr->distance = (uint)-1;
@@ -1102,9 +1102,9 @@ static void Load_SUBS(void)
SlObject(&_subsidies[index], _subsidies_desc);
}
-int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, byte cargo_type)
+int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type)
{
- int cargo = cargo_type;
+ CargoID cargo = cargo_type;
byte f;
/* zero the distance if it's the bank and very short transport. */
@@ -1131,7 +1131,7 @@ int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, b
return BIGMULSS(dist * f * num_pieces, _cargo_payment_rates[cargo], 21);
}
-static void DeliverGoodsToIndustry(TileIndex xy, byte cargo_type, int num_pieces)
+static void DeliverGoodsToIndustry(TileIndex xy, CargoID cargo_type, int num_pieces)
{
Industry* best = NULL;
Industry* ind;
@@ -1162,7 +1162,7 @@ static void DeliverGoodsToIndustry(TileIndex xy, byte cargo_type, int num_pieces
}
}
-static bool CheckSubsidised(Station *from, Station *to, byte cargo_type)
+static bool CheckSubsidised(Station *from, Station *to, CargoID cargo_type)
{
Subsidy *s;
TileIndex xy;
@@ -1230,7 +1230,7 @@ static bool CheckSubsidised(Station *from, Station *to, byte cargo_type)
return false;
}
-static int32 DeliverGoods(int num_pieces, byte cargo_type, uint16 source, uint16 dest, byte days_in_transit)
+static int32 DeliverGoods(int num_pieces, CargoID cargo_type, uint16 source, uint16 dest, byte days_in_transit)
{
bool subsidised;
Station *s_from, *s_to;