-
January 21st, 2019, 05:28 #1
The Source of an effect, question why it's based on CT Actor and not the origin
Is there a reason why the "sSource" of an effect is set to the object in the CombatTracker with current initiative instead of the actor first determined in manager_power.lua performAction()?
I'm using EffectManager.setCustomOnEffectAddStart(adndOnEffe ctAddStart); to grab the effect and search for [$NAME] within the effect string and replace it with the name of the creature placing the effect. Only problem is it seems the default method is to use the source (rEffect.sSource) from CombatTracker current initiative and not the one where the effect is drag/dropped/used from.
I'm pretty sure it's because of this code snippet:
Code:if User.isHost() then nodeTempCT = CombatManager.getActiveCT(); else
---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
-
January 23rd, 2019, 00:46 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Not sure where the original logic was built; but probably evolved over time. Based on a little testing, it seems that if rSource exists, then that should be used as effect source (even if not PC).
I'll queue it for a future patch.
Basically, changing:
Code:if ActorManager.getType(rSource) == "pc" then sSourceCT = ActorManager.getCTNodeName(rSource); end
Code:if rSource then sSourceCT = ActorManager.getCTNodeName(rSource); end
JPG
-
January 23rd, 2019, 04:26 #3
Okay, was just curious. I couldn't see a reason but was thinking there might be one I couldn't see.
Thanks, I'll patch it locally for now.---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks