Commit 852bb78
fix: reset timer tick state on workshop ss_dead reload cycles
Hook_StartupServer fires twice per workshop addon change: once via a
genuine OnLevelShutdown -> OnStartupServer sequence, and again during
the internal ss_dead reload cycle WITHOUT a preceding OnLevelShutdown.
The previous gating (PR roflmuffin#1314) suppressed the entire second call to
TimerSystem::OnStartupServer to avoid the PlayerManager-disconnect ->
stale .NET callbacks -> SEGV chain. But that also skipped the
m_has_map_ticked/m_has_map_simulated reset. On the first frame of the
reloaded session, OnGameFrame computed universal_time delta against an
unrelated last_ticked_time, producing a large positive jump. Per-map
one-off timers (notably MatchZy's 1-second AddTimer(AutoStart)) then
fired arbitrarily late mid-match -- reproducibly aborting live matches.
Fix: OnStartupServer now takes a `levelShutdown` bool. The OnLevelEnd
fan-out (and its disconnect side-effects) stays gated on it, but the
tick-state reset is unconditional. mm_plugin tracks the genuine
LevelShutdown via s_bLevelShutdownOccurred and passes it through.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 15eab93 commit 852bb78
3 files changed
Lines changed: 27 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
0 commit comments