I have been reading the script code to determine which functions are present.
I found a BUG in the function "builtin_cleararray", file src/map/script-fun.cpp.
It is obvious that the code was copied from "setarray", and they missed changing one line.
Code: Select all
if (name.startswith(".@"_s))
set_scope_reg(st, reg.iplus(i), $AARG(i));
That "$AARGIi)", should be "$AARG(1)" as in the lines that follow that. (It is hard to see that i should be a 1).
The "cleararray" function does not have a list of args like the "setarray" function, it has only the one value arg at (1).
I did not find any existing scripts that use "cleararray" with a ".@" var, so this should not affect any existing scripts.