Thanks for your response, I will file a bug for this.
I don't normally assign something to "macro.return" multiple times, this was just the shortest possible example I could imagine. The "production code" which was affected by the error is this:
Code: Select all
[h: '<!-- ==== void switchToCurrent() ==== -->']
[h, if(she_isDebug()): she_debug(getMacroName())]
[h: currentKey = "activeName_" + getPlayerName()]
[h: "<!-- check Library -->"]
[h: selected = getLibProperty(currentKey, "Lib:sheSettings")]
[h, if(she_hasTokenRights(selected)), code: {
[switchToken(selected)]
[return(0, 0)]
};{}]
[h: "<!-- check Impersonated -->"]
[h: selected = getImpersonated()]
[h, if(she_hasTokenRights(selected)), code: {
[switchToken(selected)]
[setLibProperty(currentKey, selected, "Lib:sheSettings")]
[return(0, 0)]
};{}]
[h: "<!-- check Selected -->"]
[h: selected = getSelected()]
[h, if(listCount(selected) == 1 && she_hasTokenRights(selected)), code: {
[switchToken(selected)]
[setLibProperty(currentKey, selected, "Lib:sheSettings")]
[return(0, 0)]
};{}]
[h: assert(0, "Kein Token verkörpert oder ausgewählt!")]
"she_hasTokenRights(selected)" returned true (by setting its macro.return=1), the "true" branch of the if gets executed, but "return(0,0)" did not return. This was quite tricky to pin down
, because if an other macro/UDF (e.g. she_debug("something")) is called before "return(0,0)" everything worked. I assume that's because the UDF "she_debug" did not set "macro.return" and thus apparently clearing it.