Skip to content

Commit

Permalink
[#4318] Prevent activities from being used from within compendiums
Browse files Browse the repository at this point in the history
  • Loading branch information
arbron committed Sep 18, 2024
1 parent be32700 commit 629ac43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion module/documents/activity/mixin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default Base => class extends PseudoDocumentMixin(Base) {
* @returns {Promise<ActivityUsageResults|void>} 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;
Expand Down
2 changes: 2 additions & 0 deletions module/documents/item.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 629ac43

Please sign in to comment.