No idea how to better title this, but I think I've run into something of an absurd bug. The full code is too long to post, but the gist is I'm trying to apply conditions to multiple tokens. To do so, I loop through each token, checking to see if each passes a save. If they pass, conditions are removed, if they fail, they remain. Conditions are applied, then the loop restarts and moves on to the next token.
This is done by creating a variable, effConditionInfo, before the loop is started. Within the loop, thisTokenConditionInfo is set to equal effConditionInfo. thisTokenConditionInfo is then the only variable modified (for sure). effConditionInfo is never modified once it has been set. The intent is that when moving on to the next target, thisTokenConditionInfo is set equal to the unchanged effConditionInfo to restart the whole process.
Except, for some reason, effConditionInfo is changing. effDamageInfo (which you can probably infer the purpose of) is changing. I have no clue why.
Using broadcast() functions, I narrowed down where exactly it changes - in the following section of code:```[h:broadcast(effConditionInfo+" HERE")]
[h,foreach(condition,conditionsResistedFinal): thisTokenConditionInfo = json.path.delete(thisTokenConditionInfo,"[]['Conditions'][][?(@.Name=='"+json.get(condition,"Name")+"' && @.Class=='"+json.get(condition,"Class")+"' && @.Subclass=='"+json.get(condition,"Subclass")+"')]")]
[h:broadcast(effConditionInfo)]```It should not be changing here. And yet, the "Conditions" key is empty in effConditionInfo AND thisTokenConditionInfo if that's what's supposed to be happening to thisTokenConditionInfo alone. I don't know why. Pls help.