Modules see the duration of temporary effects as 0 when no numerical values are provided
Closed this issue · 2 comments
Today's weird little rabbithole from Discord: modules like Visual Active Effects categorise most temporary effects (ie, all the durations that are EoNT/End of Encounter/etc rather than number of rounds or turns) as "expired". Digging into this a little, I see that VAE is checking effect.duration.remaining
to determine this—when it's null the effect is categorised properly, but when it's 0 the effect is considered "expired" regardless of the duration type. Which makes sense, since VAE is mostly system-agnostic and has no awareness of the 4e duration types, but is kind of misleading for players using the system.
In an effort to fix this, I'm trying out this conditional at ln231 of module/effects/effects.js:
remaining: ((d.rounds == null && d.turns == null && d.seconds == null ) ? null : remaining),
It seems to be working as intended: using remaining = 0
to calculate the correct ending time within the system's turn management, but returning null
for the actual property so it doesn't confuse modules like VAE.
However, I'm hesitant to raise a pull request immediately, as I'm worried I might be breaking some interaction elsewhere in the system. Basically it worked too well, too easily, and now I'm suspicious! :p I'd really appreciate if @EndlesNights and/or @draconas1 might want to weigh in, if you're aware of any system interactions I might be breaking!
Seems to be fine.