Fix suppression effets
This commit is contained in:
@@ -279,14 +279,16 @@ export class RdDBaseActor extends Actor {
|
||||
|
||||
async removeEffects(filter = e => true) {
|
||||
if (game.user.isGM) {
|
||||
const effectsToRemove = this.getEffects(filter)
|
||||
if (this.canRemoveEffect(effectsToRemove)) {
|
||||
const ids = effectsToRemove.map(it => it.id)
|
||||
const ids = this.getEffects(filter)
|
||||
.filter(it => this.canRemoveEffects(it))
|
||||
.map(it => it.id)
|
||||
if (ids.length > 0) {
|
||||
await this.deleteEmbeddedDocuments('ActiveEffect', ids)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
canRemoveEffect(effect) {
|
||||
canRemoveEffects(effect) {
|
||||
if (effect.statuses.has(STATUSES.StatusSurEnc)) {
|
||||
return !this.isSurenc()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user