* This function is called for each station once every 250 ticks. * Not all stations will get the tick at the same time. * @param st the station receiving the tick. * @return true if the station is still valid (wasn't deleted) */
| 3916 | * @return true if the station is still valid (wasn't deleted) |
| 3917 | */ |
| 3918 | static bool StationHandleBigTick(BaseStation *st) |
| 3919 | { |
| 3920 | if (!st->IsInUse()) { |
| 3921 | if (++st->delete_ctr >= 8) delete st; |
| 3922 | return false; |
| 3923 | } |
| 3924 | |
| 3925 | if (Station::IsExpected(st)) { |
| 3926 | TriggerWatchedCargoCallbacks(Station::From(st)); |
| 3927 | |
| 3928 | for (GoodsEntry &ge : Station::From(st)->goods) { |
| 3929 | ge.status.Reset(GoodsEntry::State::AcceptedBigtick); |
| 3930 | } |
| 3931 | } |
| 3932 | |
| 3933 | |
| 3934 | if (!st->facilities.Test(StationFacility::Waypoint)) UpdateStationAcceptance(Station::From(st), true); |
| 3935 | |
| 3936 | return true; |
| 3937 | } |
| 3938 | |
| 3939 | static inline void byte_inc_sat(uint8_t *p) |
| 3940 | { |
no test coverage detected