Is it possible to copy a struct using a native function?

Planned

Comments

2 comments

  • Julian Adams

    Realised that the example GML doesn't handle structs-in-structs.

    0
    Comment actions Permalink
  • Core Tech

    You would need to use typeof on the return from variable_struct_get then recursively call this function for "struct" returns and call array_copy for "array" returns, but it would be possible to create a "deep" copy of a struct.

    Obviously we can do it internally, but I have no plans to add it as a library function at this point, and there would be no supported way to do it in extension code (at least no officially supported way)

     

    Russell

    0
    Comment actions Permalink

Please sign in to leave a comment.