(svn r22542) -Add: Store cargo acceptance stats for stations.
This commit is contained in:
@@ -933,7 +933,7 @@ static Money DeliverGoods(int num_pieces, CargoID cargo_type, StationID dest, Ti
|
||||
{
|
||||
assert(num_pieces > 0);
|
||||
|
||||
const Station *st = Station::Get(dest);
|
||||
Station *st = Station::Get(dest);
|
||||
|
||||
/* Give the goods to the industry. */
|
||||
uint accepted = DeliverGoodsToIndustry(st, cargo_type, num_pieces, src_type == ST_INDUSTRY ? src : INVALID_INDUSTRY);
|
||||
@@ -941,6 +941,13 @@ static Money DeliverGoods(int num_pieces, CargoID cargo_type, StationID dest, Ti
|
||||
/* If this cargo type is always accepted, accept all */
|
||||
if (HasBit(st->always_accepted, cargo_type)) accepted = num_pieces;
|
||||
|
||||
/* Update station statistics */
|
||||
if (accepted > 0) {
|
||||
SetBit(st->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_EVER_ACCEPTED);
|
||||
SetBit(st->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH);
|
||||
SetBit(st->goods[cargo_type].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK);
|
||||
}
|
||||
|
||||
/* Update company statistics */
|
||||
company->cur_economy.delivered_cargo += accepted;
|
||||
if (accepted > 0) SetBit(company->cargo_types, cargo_type);
|
||||
|
Reference in New Issue
Block a user