Skip to content

fix: deleting entries from unlinked token deletes from actor#2786

Merged
mjeffw merged 1 commit into
mainfrom
bugfix/2052
Jul 15, 2026
Merged

fix: deleting entries from unlinked token deletes from actor#2786
mjeffw merged 1 commit into
mainfrom
bugfix/2052

Conversation

@rinickolous

Copy link
Copy Markdown
Collaborator

during my testing for this bug I found that when deleting an item from an unlinked token nothing initially happens but the item is then removed from the source actor after refreshing.

fixes #2052

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an inventory deletion bug for synthetic (unlinked token) actors in Foundry by ensuring removeKey updates the passed token actor instead of unintentionally resolving and updating the base world actor.

Changes:

  • Adjusts removeKey to avoid game.actors.get(actor.id) when operating on token actors (actor.isToken), preventing source actor mutation.
  • Adds clarifying inline comments explaining why token actors must be handled differently.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mjeffw
mjeffw merged commit 87c7a59 into main Jul 15, 2026
1 check passed
@mjeffw
mjeffw deleted the bugfix/2052 branch July 15, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inventory of unlinked tokens

3 participants