From 629ac43ef5cd9cd4551b0aa1a584ebd4ffe20389 Mon Sep 17 00:00:00 2001 From: Jeff Hitchcock Date: Wed, 18 Sep 2024 13:48:28 -0700 Subject: [PATCH] [#4318] Prevent activities from being used from within compendiums --- module/documents/activity/mixin.mjs | 2 +- module/documents/item.mjs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/documents/activity/mixin.mjs b/module/documents/activity/mixin.mjs index 3e54e4f552..35215e636b 100644 --- a/module/documents/activity/mixin.mjs +++ b/module/documents/activity/mixin.mjs @@ -169,7 +169,7 @@ export default Base => class extends PseudoDocumentMixin(Base) { * @returns {Promise} Details on the usage process if not canceled. */ async use(usage={}, dialog={}, message={}) { - if ( !this.item.isEmbedded ) return; + if ( !this.item.isEmbedded || this.item.pack ) return; if ( !this.item.isOwner ) { ui.notifications.error("DND5E.DocumentUseWarn", { localize: true }); return; diff --git a/module/documents/item.mjs b/module/documents/item.mjs index 452ab35c81..e5357a0152 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -754,6 +754,8 @@ export default class Item5e extends SystemDocumentMixin(Item) { * activities and was posted directly to chat. */ async use(config={}, dialog={}, message={}) { + if ( this.pack ) return; + let event = config.event; if ( config.legacy !== false ) { foundry.utils.logCompatibilityWarning(