diff options
author | belugas <belugas@openttd.org> | 2007-05-18 17:55:07 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2007-05-18 17:55:07 +0000 |
commit | 49570edfe97df43654759e9d9e492137c0fe4c2a (patch) | |
tree | 4b779bb86f97ebb5f7398c295675a5e7140c1d29 /src/economy.cpp | |
parent | ba24c34f8558369cc0802c92963b40ff5c7b0bc2 (diff) | |
download | openttd-49570edfe97df43654759e9d9e492137c0fe4c2a.tar.xz |
(svn r9870) -Codechange: Silence two compiler warnings and give proper type to the "type" member of industry struct
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index c68fe5672..d6f0e629c 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1190,7 +1190,7 @@ static void DeliverGoodsToIndustry(TileIndex xy, CargoID cargo_type, int num_pie Industry *ind; const IndustrySpec *indspec; uint best_dist; - uint accepted_cargo_index; + uint accepted_cargo_index = 0; ///< unlikely value, just for warning removing /* Check if there's an industry close to the station that accepts the cargo * XXX - Think of something better to @@ -1199,10 +1199,10 @@ static void DeliverGoodsToIndustry(TileIndex xy, CargoID cargo_type, int num_pie best_dist = (_patches.station_spread + 8) * 2; FOR_ALL_INDUSTRIES(ind) { indspec = GetIndustrySpec(ind->type); + uint i; if (indspec->produced_cargo[0] == CT_INVALID) continue; - uint i; for (i = 0; i < lengthof(indspec->accepts_cargo); i++) { if (cargo_type == indspec->accepts_cargo[i] && (indspec->input_cargo_multiplier[i][0] != 0 || indspec->input_cargo_multiplier[i][1] != 0)) { @@ -1210,6 +1210,7 @@ static void DeliverGoodsToIndustry(TileIndex xy, CargoID cargo_type, int num_pie } } + /* Check if matching cargo has been found */ if (i == lengthof(indspec->accepts_cargo)) continue; uint dist = DistanceManhattan(ind->xy, xy); |