diff options
author | terkhen <terkhen@openttd.org> | 2011-06-04 21:21:00 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-06-04 21:21:00 +0000 |
commit | 8e00fa39b2ba72ac494b728c8636ad06cd835b22 (patch) | |
tree | 501a1377603bd7955505450c462757fd6276ec50 /src/station_cmd.cpp | |
parent | 9f68c20d10886074b10b1d96e8cdce0dcc03436a (diff) | |
download | openttd-8e00fa39b2ba72ac494b728c8636ad06cd835b22.tar.xz |
(svn r22542) -Add: Store cargo acceptance stats for stations.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 9e7d1e001..7546edd46 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3001,6 +3001,13 @@ static bool StationHandleBigTick(BaseStation *st) return false; } + if (Station::IsExpected(st)) { + for (CargoID i = 0; i < NUM_CARGO; i++) { + ClrBit(Station::From(st)->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK); + } + } + + if ((st->facilities & FACIL_WAYPOINT) == 0) UpdateStationAcceptance(Station::From(st), true); return true; @@ -3171,9 +3178,18 @@ void OnTick_Station() } } +/** Monthly loop for stations. */ void StationMonthlyLoop() { - /* not used */ + Station *st; + + FOR_ALL_STATIONS(st) { + for (CargoID i = 0; i < NUM_CARGO; i++) { + GoodsEntry *ge = &st->goods[i]; + SB(ge->acceptance_pickup, GoodsEntry::GES_LAST_MONTH, 1, GB(ge->acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH, 1)); + ClrBit(ge->acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH); + } + } } |