dropping a new token on the CT to replace the current one results in error
When dropping a new token on the CT to replace the current one I get an error. (I do this for NPC's shapeshifting)
[ERROR] Script execution error: [string "combat_tracker/scripts/combat_tracker_host_..."]:60: attempt to index local 'token' (a userdata value)
This error only happens the first time. I can change the token after this error with out causing an error. Even if I exit FG and reload it wont happen after the first time.
More Details:
In tag 1.6.1, it's happening on line 67 of combat_tracker_host_ct_entry_override.lua.
The code block is here
It's erroring out on imageControl.selectToken(token.getId(), true);
:
if UDGCORERPGCOMBATHIGHLIGHTERCURRENTLYSELECTEDTOKENS then
for key,token in pairs(UDGCORERPGCOMBATHIGHLIGHTERCURRENTLYSELECTEDTOKENS) do
imageControl.selectToken(token.getId(), true);
local node = CombatManager.getCTFromToken(token);
if node then
TokenManager.updateSizeHelper(token, node);
end
end
end
Having the menu option Combat Tracker Hover Off Token Select set to Current and having the token on the map you're going to replace already selected. Right now my logic for the Current setting scenario saves off the selected tokens into a lua variable to reference them later to re-select them all. You're then replacing that token with a new one when dropping it into the combat tracker and it confuses my script when it tries to reference the old, now non-existent token. So either changing that setting to either Active CT Token or None will avoid the behavior. Or if you want to keep that setting, then make sure the token you're about to replace isn't selected on the map before you replace.