šŸ’¬

Community answer

Collected from the ACE community Discord archive around 2024-01-18. It may be informal or outdated — anyone can edit this page to improve it. Original discussion

Deep-copying tables with Vectors/Angles in Starfall

šŸ–¼ļø RenderingUpdated 2 days ago•0 views
Vectors and Angles implement a clone method and are themselves tables copied by reference - a plain table.copy won't deep-copy them. table.copy caches already-c…

Is there a difference between single-file and multi-file Lua, and how to deep-copy structures containing Vectors

Vectors and Angles implement a clone method and are themselves tables copied by reference - a plain table.copy won't deep-copy them. table.copy caches already-copied tables and keeps metatables; a custom recursive copy should use val:clone() for Vector/Angle types.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.