mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Expanded the existing _preCreate logic
This commit is contained in:
parent
38dc2d6a56
commit
9d46f94338
2 changed files with 3 additions and 11 deletions
|
|
@ -978,16 +978,6 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
return super._onDropItem(event, item);
|
||||
}
|
||||
|
||||
// Handle domain card drops
|
||||
|
||||
if (item.type === 'domainCard') {
|
||||
const {available} = this.document.system.loadoutSlot;
|
||||
if (!item?.system.inVault && !available && !item?.system.loadoutIgnore) { //Check if there's space in loadout and if the item ignores loadout limits
|
||||
item?.update({ 'system.inVault': true }); //Add to vault if no space (not working as intended. updateSource instead of update?)
|
||||
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached')); //Notify user
|
||||
}
|
||||
}
|
||||
|
||||
if (item.type === 'beastform') {
|
||||
if (this.document.effects.find(x => x.type === 'beastform')) {
|
||||
return ui.notifications.warn(
|
||||
|
|
|
|||
|
|
@ -94,8 +94,10 @@ export default class DHDomainCard extends BaseDataItem {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!this.actor.system.loadoutSlot.available) {
|
||||
if (!this.actor.system.loadoutSlot.available && !this.loadoutIgnore) {
|
||||
data.system.inVault = true;
|
||||
await this.updateSource({ inVault: true });
|
||||
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue