Fix #98 hindrance stuff

This commit is contained in:
sladecraven 2022-10-05 14:44:12 +02:00
parent e2d5a0ec74
commit d6a57de134

View File

@ -1213,11 +1213,15 @@ export class PegasusUtility {
if (token.document.disposition == 0) { if (token.document.disposition == 0) {
continue continue
} }
let disposition = ( token.document.disposition == -1) ? 1 : -1 let ennemies = []
let ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == disposition) if (token.document.disposition == -1) {
let neutrals = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && newToken.document.disposition == 0) ennemies = canvas.tokens.placeables.filter(newToken => newToken.actor.type == "character" && !newToken.document.hidden && (newToken.document.disposition == 1 || newToken.document.disposition == 0 ))
if (neutrals ) { }
ennemies = ennemies.concat(neutrals) 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) { for (let ennemy of ennemies) {
if (ennemy.actor.id != token.actor.id) { if (ennemy.actor.id != token.actor.id) {