* Spawn or join a link graph job or compress a link graph if any link graph is * due to do so. */
| 200 | * due to do so. |
| 201 | */ |
| 202 | void OnTick_LinkGraph() |
| 203 | { |
| 204 | if (TimerGameEconomy::date_fract != LinkGraphSchedule::SPAWN_JOIN_TICK) return; |
| 205 | TimerGameEconomy::Date offset{TimerGameEconomy::date.base() % (_settings_game.linkgraph.recalc_interval / EconomyTime::SECONDS_PER_DAY)}; |
| 206 | if (offset == 0) { |
| 207 | LinkGraphSchedule::instance.SpawnNext(); |
| 208 | } else if (offset == (_settings_game.linkgraph.recalc_interval / EconomyTime::SECONDS_PER_DAY) / 2) { |
| 209 | if (!_networking || _network_server) { |
| 210 | PerformanceMeasurer::SetInactive(PFE_GL_LINKGRAPH); |
| 211 | LinkGraphSchedule::instance.JoinNext(); |
| 212 | } else { |
| 213 | PerformanceMeasurer framerate(PFE_GL_LINKGRAPH); |
| 214 | LinkGraphSchedule::instance.JoinNext(); |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 |
no test coverage detected