Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Problem with structs copying

    Bug Reporting (FUZE 4 Nintendo Switch)
    5
    7
    355
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      void00 F last edited by

      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.

      Dave 1 Reply Last reply Reply Quote 0
      • Dave
        Dave Fuze Team @void00 last edited by

        @void00 We weren't aware of the struct copy problem until well after the patch had been submitted.

        V 1 Reply Last reply Reply Quote 0
        • V
          void00 F @Dave last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • Martin
            Martin Fuze Team last edited by

            I've moved this to a seperate topic under bug reporting to keep the announcement topic clean

            1 Reply Last reply Reply Quote 0
            • Zero Division
              Zero Division last edited by

              Does using a typed struct help?

              1 Reply Last reply Reply Quote 0
              • V
                void00 F last edited by

                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

                1 Reply Last reply Reply Quote 1
                • PB____
                  PB____ last edited by Martin

                  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.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post