-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance table.Copy #2036
base: master
Are you sure you want to change the base?
Enhance table.Copy #2036
Conversation
Added arguments fullCopy and noMeta, made it error if the first argument isn't a table, improved the comment, and a few other changes. fullCopy will make the function copy Vector and Angle objects noMeta will ignore the metatable of the given table
- Edge case for colors not being given the Color metatable is noMeta is on - Fix fullCopy ignoring values that aren't Vectors or Angles
Would suggest changing I believe sub-tables shouldn't be effected by |
Changing Yeah, changing |
Right, then |
Gotcha. |
Why copy vectors and angles but not matrices and colors? |
Colors: Colors are tables, it already copies them. |
Added VMatrix support. |
Changes
Added Arguments
copyVecAngMx
- Will make the function copy Vector, Angle, and VMatrix objects.noMeta
- Will not set the metatable of the given table to the copy result, if there is one.Additional Changes
The function will yield an error if the first argument isn't a table.
The function now only sets the metatable of the given table to the copy result after everything has been copied.
Updated the command description in the comment above it.
There is some changes I want to discuss in this PR, however:
Is making the function error a bad idea? Will it break some addons?
Will making the function set the metatable to the copy after it's done copying cause issues?
Should the
copyVecAngMx
argument even exist, or should I make it always copy Vector, Angle, and VMatrix objects?Is the backwards compatibility for the
lookup_table
argument even necessary?I am looking forward to reading the thoughts on this. Thanks