Problem with structs copying
-
Glad for the new patch but was really hoping that structs where copy changes the original was going to be fixed but it still not and hopefully maybe the buffer overflow is fixed at least.
-
@void00 We weren't aware of the struct copy problem until well after the patch had been submitted.
-
@Dave
I see because it’s because I am trying to create a quad tree but the variable using to loop through the structs just copy everything because I have a next inside the struct so when I loop and set variable to next struct the original struct in Variable just becomes next completely. -
I've moved this to a seperate topic under bug reporting to keep the announcement topic clean
-
Does using a typed struct help?
-
It still change the original but looping through it does not which is a bit of good news let me do more testing and see. Also is there a way to check if a variable in struct is null
-
Found a problem with arrays being copied, not sure if it's related to this one.
I didn't test the code written below, but this should reproduce the issue I had with arrays not being addressed by reference:
/// START OF SNIPPET values = [ [1,2], [3,4] ] for i = 0 to 2 loop row = values[i] for n = 0 to 2 loop row[n] = row[n] + 1 repeat // to fix this: // values[i] = row repeat print(values) update() sleep(10) /// END OF SNIPPET
I normally wouldn't expect to need the commented code
values[i] = row
.