Repository navigation
fix: IW3 & T4 restrict VM shutdown handlers to game script shutdowns - #257
Merged
michaeloliverx merged 2 commits intoOct 7, 2026
Merged
michaeloliverx merged 2 commits into
michaeloliverx merged 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
fix: IW3 & T4 restrict VM shutdown handlers to game script shutdowns
Description
Fixes IW3 & T4 VM shutdown handling so plugin-owned script state is only cleared when the game script system is actually being torn down.
Previously,
vmShutdownHandlerswere executed for everyScr_ShutdownSystemcall regardless of thesysvalue. IW3 & T4 uses this value to identify different script/string-system shutdown categories, including temporary and zone-related cleanup.Temporary shutdowns occur during normal gametype initialization and transitions. Treating these as a complete VM shutdown caused persistent script state, such as
replacefuncmappings, to be cleared prematurely.The shutdown hook now executes VM shutdown handlers only for
SCRIPT_USER_GAME a.k.a. sys == 1for IW3 andbCompleteon T4.This prevents temporary shutdowns from incorrectly clearing game VM state.
Changes
vmShutdownHandlerstoSCRIPT_USER_GAMEshutdowns.replacefuncmappings and other VM-owned state from being cleared during normal gametype initialization.