| 4340 | } |
| 4341 | |
| 4342 | void OnTick_Station() |
| 4343 | { |
| 4344 | if (_game_mode == GM_EDITOR) return; |
| 4345 | |
| 4346 | for (BaseStation *st : BaseStation::Iterate()) { |
| 4347 | StationHandleSmallTick(st); |
| 4348 | |
| 4349 | /* Clean up the link graph about once a week. */ |
| 4350 | if (Station::IsExpected(st) && (TimerGameTick::counter + st->index) % Ticks::STATION_LINKGRAPH_TICKS == 0) { |
| 4351 | DeleteStaleLinks(Station::From(st)); |
| 4352 | }; |
| 4353 | |
| 4354 | /* Spread out big-tick over STATION_ACCEPTANCE_TICKS ticks. */ |
| 4355 | if ((TimerGameTick::counter + st->index) % Ticks::STATION_ACCEPTANCE_TICKS == 0) { |
| 4356 | /* Stop processing this station if it was deleted */ |
| 4357 | if (!StationHandleBigTick(st)) continue; |
| 4358 | } |
| 4359 | |
| 4360 | /* Spread out station animation over STATION_ACCEPTANCE_TICKS ticks. */ |
| 4361 | if ((TimerGameTick::counter + st->index) % Ticks::STATION_ACCEPTANCE_TICKS == 0) { |
| 4362 | TriggerStationAnimation(st, st->xy, StationAnimationTrigger::AcceptanceTick); |
| 4363 | TriggerRoadStopAnimation(st, st->xy, StationAnimationTrigger::AcceptanceTick); |
| 4364 | if (Station::IsExpected(st)) TriggerAirportAnimation(Station::From(st), AirportAnimationTrigger::AcceptanceTick); |
| 4365 | } |
| 4366 | } |
| 4367 | } |
| 4368 | |
| 4369 | /** Economy monthly loop for stations. */ |
| 4370 | static const IntervalTimer<TimerGameEconomy> _economy_stations_monthly({TimerGameEconomy::MONTH, TimerGameEconomy::Priority::STATION}, [](auto) |
no test coverage detected