Skip to content

Commit

Permalink
Copy metatable in table.deepcopy
Browse files Browse the repository at this point in the history
Copy metatable as well during deep copying
  • Loading branch information
RichardTry authored Dec 18, 2024
1 parent babb6a6 commit 61741a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion res/scripts/stdmin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function table.deep_copy(t)
end
end

return copied
return setmetatable(copied, getmetatable(t))
end

function table.count_pairs(t)
Expand Down

0 comments on commit 61741a5

Please sign in to comment.