summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-06-04 21:21:00 +0000
committerterkhen <terkhen@openttd.org>2011-06-04 21:21:00 +0000
commit8e00fa39b2ba72ac494b728c8636ad06cd835b22 (patch)
tree501a1377603bd7955505450c462757fd6276ec50 /src/station_cmd.cpp
parent9f68c20d10886074b10b1d96e8cdce0dcc03436a (diff)
downloadopenttd-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.cpp18
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);
+ }
+ }
}