Based on a conversation we had on the Fantasy Grounds forms I realized we were calling Token.getDistanceBetween for every aura a character had. With this change we now store the distance & friend-ness of 2 tokens reducing the number of calls when there is more than 1 aura between them. I'm able to do this because tables in lua are passed by reference, so value of local nodeInfo persists between invocations of checkAuraApplicationAndAddOrRemove
In total with this change we should only call Token.getDistanceBetween and query the friend-ness once per combatant in the combat tracker.
Based on a conversation we had on the Fantasy Grounds forms I realized we were calling
Token.getDistanceBetween
for every aura a character had. With this change we now store the distance & friend-ness of 2 tokens reducing the number of calls when there is more than 1 aura between them. I'm able to do this because tables in lua are passed by reference, so value oflocal nodeInfo
persists between invocations ofcheckAuraApplicationAndAddOrRemove
In total with this change we should only call
Token.getDistanceBetween
and query the friend-ness once per combatant in the combat tracker.