From d5909f901a8558dbfc562c75a387d66251c6ed20 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sun, 26 Mar 2006 22:23:32 +0000 Subject: (svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type. --- economy.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'economy.c') 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; -- cgit v1.2.3-70-g09d2