Fix for the "bought_at_rank" value when an Item was on dropped on a sheet.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"description": "This is an authorised multilingual game system En|Fr|Es, for Legend of the Five Rings (5th Edition) by <a href='https://edge-studio.net/'>Edge Studio</a> <p> - Join the official Discord server: <a href='https://discord.gg/foundryvtt'> Official Discord</a></p><p> - Rejoignez la communauté Francophone: <a href='https://discord.gg/pPSDNJk'>Francophone Discord</a></p>",
|
||||
"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",
|
||||
|
||||
Reference in New Issue
Block a user