Fix protection and other maintained status effects

Protection and other system status effects still had a duration when
being maintained.

Fixes #44
This commit is contained in:
2024-08-11 13:40:19 -05:00
parent abfed3204b
commit 8e9827e5ae
2 changed files with 9 additions and 3 deletions
+2 -3
View File
@@ -134,13 +134,12 @@ export class PowerEffect {
static async getStatus(label, name, favorite = true) {
const effect = foundry.utils.deepClone(CONFIG.statusEffects.find((se) => se.label === label || se.name === label));
effect.name = 'name' in effect ? effect.name : effect.label;
effect.duration = {};
if (!('flags' in effect)) {
effect.flags = {};
}
effect.flags.swade = {};
if (favorite) {
if (!('swade' in effect.flags)) {
effect.flags.swade = {};
}
effect.flags.swade.favorite = true;
}
effect.statuses ??= [];