Repository navigation
Never free a reused crafted potion when recreating traded items - #10
Merged
absol89 merged 1 commit intoOct 7, 2026
Merged
Conversation
AddPotion/AddPoison can return an existing created potion, including one the player already holds. Releasing it on a recipe mismatch could free a form an inventory still points at. Refuse it without releasing, ignore effect cost (gold value only) in the check, and log both recipes so a refused potion can be diagnosed from the client log. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid
absol89
marked this pull request as ready for review
October 7, 2026 09:40
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.
Before: when the engine's AddPotion/AddPoison returned a potion whose effects didn't exactly match the traded recipe (including its gold cost), the client dropped that potion's created-object reference and refused the item. The engine can hand back an existing potion with the same effects, so this could free a form still held in an inventory. On 1.8.3-25, the receiving player crashed the next time that inventory was searched:
Cast<AlchemyItem>inAlchemyItem::Find, called fromTESObjectREFR::AddOrRemoveItemwhile removing a crafted potion from the partner's character (symbolized from the playtest crash log). The other player never received the refused potion.After: a mismatched result is refused without touching its reference, effect cost is ignored in the check because it only affects gold value, and both recipes are written to the client log when a potion is refused.
How:
AlchemyItem::Createcompares effect, magnitude, area and duration (order-insensitive), never calls DecrementRef, and logs wanted and returned effects on a mismatch. The now-unusedAlchemyItem::Releaseis removed, so no client code drops a created-object reference anymore.🤖 Generated with Claude Code
https://claude.ai/code/session_01SSW5HGXzi9kAVm4zdsSaid