Commit 0b62d53
Fix standalone crash when client disconnects before mission loads
When a client connects to a standalone server and backs out before a
mission is loaded, multi_standalone_reset_all() calls game_level_close()
which fires OnMissionAboutToEnd/OnMissionEnd scripting hooks. If any
mod script calls mn.evaluateSEXP() from those hooks, alloc_sexp() crashes
because the SEXP system was never initialized (Locked_sexp_true/false
are still -1, Sexp_nodes is nullptr).
Guard multi_standalone_reset_all() to only call game_level_close() when
GM_IN_MISSION is set, and additionally guard game_level_close() to skip
scripting hooks when Sexp_nodes is uninitialized.
Fixes #7353
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 43a475a commit 0b62d53
2 files changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1671 | 1671 | | |
1672 | 1672 | | |
1673 | 1673 | | |
1674 | | - | |
1675 | | - | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1676 | 1681 | | |
1677 | 1682 | | |
1678 | 1683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
913 | | - | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
914 | 920 | | |
915 | 921 | | |
916 | 922 | | |
| |||
999 | 1005 | | |
1000 | 1006 | | |
1001 | 1007 | | |
1002 | | - | |
| 1008 | + | |
1003 | 1009 | | |
1004 | 1010 | | |
1005 | 1011 | | |
| |||
0 commit comments