From 855e3272fcf706ef605bcb860015a6aef3cb6116 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Wed, 16 Jun 2021 08:59:39 +0200 Subject: [PATCH] Fixed the "unlink actor data" who still change the Actor Data. --- CHANGELOG.md | 1 + system/scripts/actor.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2be0e4c..844edec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fixed the "empty sheet" bug ! (I hope) - Fixed the "bought_at_rank" does not change according to the PC rank value when an Item is drop on a sheet. - Fixed the issue #23 "Token image does not save". Now we reflect the change on the token name/image only if it's a linked actor and if the token/sheet have the same values. +- Fixed the "unlink actor data" who still change the Actor Data. ## 1.3.0 - Foundry 0.8 Compatibility __! Be certain to carefully back up any critical user data before installing this update !__ diff --git a/system/scripts/actor.js b/system/scripts/actor.js index a385c7c..dea8169 100644 --- a/system/scripts/actor.js +++ b/system/scripts/actor.js @@ -69,6 +69,10 @@ export class ActorL5r5e extends Actor { data["_id"] = this.id; } + // Context informations (needed for unlinked token update) + context.parent = this.parent; + context.pack = this.pack; + // Only on linked Actor if (data.token?.actorLink || (data.token?.actorLink === undefined && this.data.token.actorLink)) { // Update the token name/image if the sheet name/image changed, but only if they was previously the same