I have two structs: A “Department”-struct and a “Team”-struct. A department can have multiple teams, so the department-struct contains an array of team-structs amongst other things. Also there can be multiply departments, so I have an array of departments.
All in all I have an array of structs (Ds) and each of these contains another array of structs (Ts).
At some point in my game I have to recalculate some of the variables of both the departments and their teams.
As seen in the attached screenshot, I have two for-each loops looping through the arrays and calling a function, which does my calculations.
At first I tried to work with references I give to the functions (so without the set array elem at the end), but it did not work, as well as my second idea with the set array elem call. It neither works to insert a new element.
The problem is, the variables I changed are not set in the array. They remain the default value I set in the details panel before compiling
Until after my functions, everything is fine. The values are correct calculated and the updated structs are returned correctly (I checked with Print String). The only problem is setting them in the arrays.
Am I doing something wrong or are arrays of structs a little buggy in the current release? I found some threads about similar problems, but not exactly the same problem as mine.
Thanks in advance