mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 07:36:26 +01:00
remove spurious defenses
This commit is contained in:
parent
76c5dc2404
commit
1c6188cda8
2 changed files with 6 additions and 6 deletions
|
|
@ -56,7 +56,7 @@ export default class ArmorSheet extends DHBaseItemSheet {
|
||||||
context.features = this.document.system.features.map(x => x.value);
|
context.features = this.document.system.features.map(x => x.value);
|
||||||
break;
|
break;
|
||||||
case 'attachments':
|
case 'attachments':
|
||||||
const attachedUUIDs = this.document.system.attached || [];
|
const attachedUUIDs = this.document.system.attached;
|
||||||
context.attachedItems = await Promise.all(
|
context.attachedItems = await Promise.all(
|
||||||
attachedUUIDs.map(async uuid => {
|
attachedUUIDs.map(async uuid => {
|
||||||
const item = await fromUuid(uuid);
|
const item = await fromUuid(uuid);
|
||||||
|
|
@ -97,7 +97,7 @@ export default class ArmorSheet extends DHBaseItemSheet {
|
||||||
const item = await Item.implementation.fromDropData(data);
|
const item = await Item.implementation.fromDropData(data);
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
|
||||||
const currentAttached = this.document.system.attached || [];
|
const currentAttached = this.document.system.attached;
|
||||||
const newUUID = item.uuid;
|
const newUUID = item.uuid;
|
||||||
|
|
||||||
if (currentAttached.includes(newUUID)) {
|
if (currentAttached.includes(newUUID)) {
|
||||||
|
|
@ -147,7 +147,7 @@ export default class ArmorSheet extends DHBaseItemSheet {
|
||||||
*/
|
*/
|
||||||
static async #removeAttachment(event, target) {
|
static async #removeAttachment(event, target) {
|
||||||
const uuid = target.dataset.uuid;
|
const uuid = target.dataset.uuid;
|
||||||
const currentAttached = this.document.system.attached || [];
|
const currentAttached = this.document.system.attached;
|
||||||
|
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid)
|
'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export default class WeaponSheet extends DHBaseItemSheet {
|
||||||
context.systemFields.attack.fields = this.document.system.attack.schema.fields;
|
context.systemFields.attack.fields = this.document.system.attack.schema.fields;
|
||||||
break;
|
break;
|
||||||
case 'attachments':
|
case 'attachments':
|
||||||
const attachedUUIDs = this.document.system.attached || [];
|
const attachedUUIDs = this.document.system.attached;
|
||||||
context.attachedItems = await Promise.all(
|
context.attachedItems = await Promise.all(
|
||||||
attachedUUIDs.map(async uuid => {
|
attachedUUIDs.map(async uuid => {
|
||||||
const item = await fromUuid(uuid);
|
const item = await fromUuid(uuid);
|
||||||
|
|
@ -97,7 +97,7 @@ export default class WeaponSheet extends DHBaseItemSheet {
|
||||||
const item = await Item.implementation.fromDropData(data);
|
const item = await Item.implementation.fromDropData(data);
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
|
|
||||||
const currentAttached = this.document.system.attached || [];
|
const currentAttached = this.document.system.attached;
|
||||||
const newUUID = item.uuid;
|
const newUUID = item.uuid;
|
||||||
|
|
||||||
if (currentAttached.includes(newUUID)) {
|
if (currentAttached.includes(newUUID)) {
|
||||||
|
|
@ -131,7 +131,7 @@ export default class WeaponSheet extends DHBaseItemSheet {
|
||||||
*/
|
*/
|
||||||
static async #removeAttachment(event, target) {
|
static async #removeAttachment(event, target) {
|
||||||
const uuid = target.dataset.uuid;
|
const uuid = target.dataset.uuid;
|
||||||
const currentAttached = this.document.system.attached || [];
|
const currentAttached = this.document.system.attached;
|
||||||
|
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid)
|
'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue