Repository navigation
Harden trade item application after sender crash - #9
Merged
absol89 merged 1 commit intoOct 7, 2026
Merged
Conversation
A sender crashed in a dynamic cast while its game applied the traded items to the partner's remote character. Remove the paths that could leave the engine pointing at freed or foreign data there: - Keep created-potion references instead of releasing them after the item is added; the inventory may not hold its own reference. - Stop creating potion forms just to name partner offers in the UI. - Never pass RemoveItem an extra data list the inventory does not own; fall back to removing without extra data. - Refuse to create an enchantment whose effect setting is missing, and skip attaching a missing enchantment instead of attaching null. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid
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.
Requested by Eric · project thread
Before: in the playtest, when the countdown finished, the sending player crashed while their game was adding the traded items to the partner's remote character. CrashLogger reported an access violation inside a dynamic cast on a pointer that was not a valid object, and the items were lost.
After: applying a trade no longer frees, invents or hands the engine forms and extra data it doesn't own. These are the paths that could leave the engine pointing at freed or foreign data at that moment.
Without symbols for the Skyrim Together module, the crash log can't name the exact function. This change removes the plausible causes rather than fixing one confirmed line.
How:
AddOrRemoveItemno longer releases the created-potion reference after adding the item, and the trade service no longer releases its prepared potions. If the inventory doesn't take its own reference, releasing ours could free a form it still points at.RemoveItemnow gets no extra data at all instead of a rebuilt list the inventory doesn't own.EnchantmentItem::Createreturns null when an effect setting is missing.GetExtraDataFromItemthen skips attaching the enchantment instead of attaching a null one.Verification: these are client-only changes, so only the Windows CI build covers them. The crash still needs reproducing in-game, preferably with a symbolized crash log.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid
Generated by Claude Code