PDA

View Full Version : Bug? in EffectManager.getEffectsByType()



mattekure
October 19th, 2023, 02:25
While working on an extension update, I began noticing something I believe is a bug in CoreRPG. I was attempting to call the EffectManager.getEffectsByType() function and noticed that when I did, the cycler button on the combat tracker which turns the effect on/off breaks. It no longer allows you to change it.

Attached is a simplified test extension which demonstrates the effect. To make it happen, add a token to the combat tracker. Give it an effect "AURA: 10" Once the effect is applied, the on/off cycler button should no longer work.

Tested in CoreRPG, FG v4.4.4 2023-10-18 no other extensions loaded.

https://i.imgur.com/C8qMbTl.png

Moon Wizard
October 19th, 2023, 04:04
Thanks for the report.

The low-level function there is only being used for vision/light effects currently, which don't expire. Since you are checking for a new type of effect that is not marked as expiring, it is resetting the Aura effect from Skip -> On when it checks for the effect type. Because you are checking during an update cycle, the button immediately gets reset. (i.e. Skip -> Check -> Turn Back On)

If you add the following line to your code, it will not do that:
EffectManager.registerEffectCompType("AURA", { bIgnoreExpire = true, bIgnoreTarget = true });

This area of the code is still only partially developed to where I would like it to be. I had started to generalize the code to support more scenarios, but had to set that down for the moment. The above code should get you going, if you still want to use that function.

Regards,
JPG

mattekure
October 19th, 2023, 12:29
Thanks much, that seems to work.