(svn r23233) -Codechange: Refactor maximum and actually transported cargo amount of towns into a reusable struct.

This commit is contained in:
michi_cc
2011-11-15 20:47:53 +00:00
parent 88aaeb4092
commit 6548ec6e9e
9 changed files with 110 additions and 116 deletions

View File

@@ -990,8 +990,8 @@ static Money DeliverGoods(int num_pieces, CargoID cargo_type, StationID dest, Ti
/* Increase town's counter for some special goods types */
const CargoSpec *cs = CargoSpec::Get(cargo_type);
if (cs->town_effect == TE_FOOD) st->town->new_act_food += accepted;
if (cs->town_effect == TE_WATER) st->town->new_act_water += accepted;
if (cs->town_effect == TE_FOOD) st->town->food.new_act += accepted;
if (cs->town_effect == TE_WATER) st->town->water.new_act += accepted;
/* Determine profit */
Money profit = GetTransportedGoodsIncome(accepted, DistanceManhattan(source_tile, st->xy), days_in_transit, cargo_type);