Fixed so effects are only applied to correct tokens (#1439)

This commit is contained in:
WBHarry 2025-12-18 23:55:25 +01:00 committed by GitHub
parent 0936b46926
commit 27fe83d906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 11 deletions

View file

@ -28,6 +28,7 @@ export default class DhpCombat extends Combat {
...effect,
name: game.i18n.localize(effect.name),
description: game.i18n.localize(effect.description),
effectTargetTypes: grouping.effectTargetTypes ?? [],
flags: {
[`${CONFIG.DH.id}.${CONFIG.DH.FLAGS.combatToggle}`]: {
category: toggle.category,
@ -45,11 +46,7 @@ export default class DhpCombat extends Combat {
for (let actor of actors) {
await actor.createEmbeddedDocuments(
'ActiveEffect',
effects.map(effect => ({
...effect,
name: game.i18n.localize(effect.name),
description: game.i18n.localize(effect.description)
}))
effects.filter(x => x.effectTargetTypes.includes(actor.type))
);
}
} else {