by phantombeta » Sat Dec 01, 2018 9:40 am
Somewhat user error, actually. Caused by an insane, non-sensical, ill-advised, terrible decision in the ZScript compiler.
Function-local variables are never initialized at all. The VM's registers are, but that only happens once, so any variables defined after anything that isn't a variable definition will contain garbage data. And this extends to dynamic arrays.
TL;DR User error caused by a terrible design decision in the ZScript compiler. Always clear your dynamic arrays.
Somewhat user error, actually. Caused by an insane, non-sensical, ill-advised, terrible decision in the ZScript compiler.
Function-local variables are never initialized at all. The VM's registers are, but that only happens once, so any variables defined after anything that isn't a variable definition will contain garbage data. And this extends to dynamic arrays.
TL;DR User error caused by a terrible design decision in the ZScript compiler. [b]Always clear your dynamic arrays.[/b]