summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-11-23 16:05:19 +0000
committertruebrain <truebrain@openttd.org>2011-11-23 16:05:19 +0000
commit229e572663158d8fd37cabf3c2a3cb06811ff0a1 (patch)
treee27f01fdf1de01262be29bb795b0be8d54b04f5e /src/economy.cpp
parent4e09cde6495f35a6d56cacc0dbf636df7bc94dbd (diff)
downloadopenttd-229e572663158d8fd37cabf3c2a3cb06811ff0a1.tar.xz
(svn r23298) -Add: track statistics of all incoming and outgoing goods. Incoming based on TownEffect, outgoing based on CargoType (based on patch by Terkhen)
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 9a6dea24d..90cfb83e7 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -988,10 +988,9 @@ static Money DeliverGoods(int num_pieces, CargoID cargo_type, StationID dest, Ti
company->cur_economy.delivered_cargo += accepted;
if (accepted > 0) SetBit(company->cargo_types, cargo_type);
- /* Increase town's counter for some special goods types */
+ /* Increase town's counter for town effects */
const CargoSpec *cs = CargoSpec::Get(cargo_type);
- if (cs->town_effect == TE_FOOD) st->town->food.new_act += accepted;
- if (cs->town_effect == TE_WATER) st->town->water.new_act += accepted;
+ st->town->received[cs->town_effect].new_act += accepted;
/* Determine profit */
Money profit = GetTransportedGoodsIncome(accepted, DistanceManhattan(source_tile, st->xy), days_in_transit, cargo_type);