diff --git a/system/scripts/actors/base-sheet.js b/system/scripts/actors/base-sheet.js index 9bb7230..e91784e 100644 --- a/system/scripts/actors/base-sheet.js +++ b/system/scripts/actors/base-sheet.js @@ -203,22 +203,7 @@ export class BaseSheetL5r5e extends ActorSheet { // Item subtype specific switch (item.data.type) { - case "bond": // no break - case "peculiarity": // no break - case "item_pattern": // no break - case "signature_scroll": - // Modify the bought at rank to the current actor rank - if (this.actor.data.data.identity?.school_rank) { - item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; - } - break; - case "advancement": - // Modify the bought at rank to the current actor rank - if (this.actor.data.data.identity?.school_rank) { - item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; - } - // Specific advancements, remove 1 to selected ring/skill await this.actor.addBonus(item); break; @@ -265,21 +250,21 @@ export class BaseSheetL5r5e extends ActorSheet { item.data.data.xp_cost > 0 ? item.data.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost; item.data.data.xp_used = item.data.data.xp_cost; } - - // Modify the bought at rank to the current actor rank - if (this.actor.data.data.identity?.school_rank) { - item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; - } break; } + // Modify the bought at rank to the current actor rank + if (item.data.data.bought_at_rank !== undefined && this.actor.data.data.identity?.school_rank) { + item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; + } + // Ok add item - Foundry override cause props const allowed = Hooks.call("dropActorSheetData", this.actor, this, item); if (allowed === false) { return; } - return this._onDropItemCreate(item.data.toJSON()); + return this._onDropItemCreate(item.data.toObject(false)); } /** diff --git a/system/system.json b/system/system.json index cc2a426..32706d7 100644 --- a/system/system.json +++ b/system/system.json @@ -4,8 +4,8 @@ "description": "This is an authorised multilingual game system En|Fr|Es, for Legend of the Five Rings (5th Edition) by Edge Studio

- Join the official Discord server: Official Discord

- Rejoignez la communauté Francophone: Francophone Discord

", "url": "https://gitlab.com/teaml5r/l5r5e", "manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json", - "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.3.0/raw/l5r5e.zip?job=build", - "version": "1.3.0", + "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.3.1/raw/l5r5e.zip?job=build", + "version": "1.3.1", "minimumCoreVersion": "0.8.5", "compatibleCoreVersion": "0.8.6", "manifestPlusVersion": "1.0.0",