MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / StationHandleBigTick

Function StationHandleBigTick

src/station_cmd.cpp:3918–3937  ·  view source on GitHub ↗

* 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) */

Source from the content-addressed store, hash-verified

3916 * @return true if the station is still valid (wasn't deleted)
3917 */
3918static 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
3939static inline void byte_inc_sat(uint8_t *p)
3940{

Callers 1

OnTick_StationFunction · 0.85

Calls 5

UpdateStationAcceptanceFunction · 0.85
IsInUseMethod · 0.80
TestMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected