Closed PatrickSzela closed 1 month ago
Thank you for letting me know about this. There are three workarounds to this:
appending += new Test(texts[i])
with appending.ModAppend(new Test(texts[i]))
ds.toml
and add the line: new_class_register_optimization = false
Test item = new Test(texts[i]);
appending += item;
This bug was introduced in a recent commit: 520c266. That commit introduced an optimization for this scenario:
// Rather than creating a new register for assigning to the heap, `a` is used instead since it is being overwritten anyway.
a = new Test();
This optimization incorrectly triggers with the +=
operator, which is a modification and not an overwrite.
Somewhere between release
v3.0.0
and currentmaster
build, appending a class instance to an array stopped working correctly.Based on this example code:
After compiling and executing the code in game - even though 5 class instances per array are being created - for some reason
appending
array ends up containing only 2 elements, compared to 5 elements insettingByIndex
Output of the Workshop Inspector:
One day Blizzard is going to fix the Variables view, right? 😩