Fixed the "unlink actor data" who still change the Actor Data.

This commit is contained in:
Vlyan
2021-06-16 08:59:39 +02:00
parent ae2229bc28
commit 855e3272fc
2 changed files with 5 additions and 0 deletions

View File

@@ -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 !__

View File

@@ -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