Avoid partial attachment restore teardown crash (#107) - #2
Merged
Conversation
Keep the normal attachment Hide path unchanged, but use cleanup-only teardown when a failed restore leaves the attachment without physics. Fixes themuffinator/openQ4#107
This was referenced Aug 15, 2026
Owner
Author
|
Final hosted validation for f13391c: all 14 push and pull-request checks passed across Windows x64, Linux x64 GCC/Clang, Linux ARM64 GCC/Clang, and macOS ARM64/Intel. Engine release-note PR themuffinator/openQ4#113 has merged, so this fix can now land and close themuffinator/openQ4#107 in the intended order. |
themuffinator
marked this pull request as ready for review
August 15, 2026 16:49
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.
What changed
idAFAttachment::ClearBody()in both SP and MP for the narrow case where a failed restore leaves the attachment without a physics object.Hide()path for every fully initialized attachment.UpdateModelTransform()null guard.Root cause
The attached v0.11 dump was symbolized against the exact shipped GameLib PDB. A restore error aborts map initialization and tears down a partially restored actor. Its head attachment has been allocated but has not yet received its physics pointer, so
ClearBody()calledHide(), which reachedidEntity::UpdateModelTransform()and dereferenced null physics. The crash occurred during error cleanup and obscured the original restore failure.The fix performs cleanup-only teardown for that partial state (
FreeModelDef()andUnlinkCombat()), while leaving ordinary runtime hiding unchanged.Validation
python tools/tests/savegame_corruption_contract.pypython -m py_compile tools/tests/savegame_corruption_contract.pygame-spandgame-mpcompile and linkFixes themuffinator/openQ4#107