fix: fix effects not being surpressed for unlinked token actors

This commit is contained in:
Johannes Loher 2021-09-23 12:45:53 +02:00
parent 8f3a72a7f4
commit 4974482325

View file

@ -43,7 +43,8 @@ export class DS4ActiveEffect extends ActiveEffect {
if (!(this.parent instanceof DS4Actor)) { if (!(this.parent instanceof DS4Actor)) {
return; return;
} }
const [, , , itemId] = this.data.origin?.split(".") ?? []; const itemIdRegex = /Item\.([a-zA-Z0-9]+)/;
const itemId = this.data.origin?.match(itemIdRegex)?.[1];
if (!itemId) { if (!itemId) {
return; return;
} }