Array inside structure generates invalid ArrayGet wrapper
Brought to you by:
acceptthis,
timeserv
Arrays inside of structs do not generate proper ArrayGet/Set wrappers. This only happens when extensions are off (obviously), but prevents arrays from working at all, and will always throw "out of bounds" errors.
Here's QC to reproduce:
entity world;
struct nested_struct
{
int x, y;
float array[10];
};
struct test_struct
{
float array[17];
float a, b;
nested_struct strect;
};
.test_struct stroct;
.float tempst[10];
void() test_func =
{
float x = 5;
world.stroct.array[x] = 5f;
world.stroct.strect.array[x] = 5f;
world.tempst[x] = 5f;
};
Two functions will be made here, ArrayGet*stroct and ArrayGet*tempst. Note that ArrayGet*stroct's bytecode assumes it's a 1-length array, nor does it generate two functions for the two different arrays being referenced.
(There's also a secondary error that will occur if you comment out the array in nested_struct, inwhich the name of the struct becomes garbage in the error message).
This is a huge breaker for what I'm trying to do :(
This appears to be fixed. I tried it on its own as well as incorporating into a server progs and the code compiles and runs without issue.
Moved to https://github.com/fte-team/fteqw/issues/67