diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 1deaa5f..aef1fc9 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -1213,11 +1213,15 @@ export class PegasusUtility { if (token.document.disposition == 0) { continue } - let disposition = ( token.document.disposition == -1) ? 1 : -1 - let ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == disposition) - let neutrals = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == 0) - if (neutrals ) { - ennemies = ennemies.concat(neutrals) + let ennemies = [] + if (token.document.disposition == -1) { + ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == 1 || newToken.document.disposition == 0 )) + } + if (token.document.disposition == 1) { + ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 0 )) + } + if (token.document.disposition == 0) { + ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == -1 || newToken.document.disposition == 1 )) } for (let ennemy of ennemies) { if (ennemy.actor.id != token.actor.id) {