mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-08-31 09:28:30 -04:00
Fix serialization function to guard internal values
This commit is contained in:
parent
079c1d0e18
commit
d8621e4070
1 changed files with 10 additions and 3 deletions
|
@ -47,11 +47,18 @@ end
|
|||
function Component:__populate() -- luacheck: ignore
|
||||
end
|
||||
|
||||
function Component:serialize() -- luacheck: ignore
|
||||
return Utils.shallowCopy(self, {})
|
||||
function Component:serialize()
|
||||
local data = Utils.shallowCopy(self, {})
|
||||
|
||||
--This values shouldn't be copied over
|
||||
data.__componentClass = nil
|
||||
data.__isComponent = nil
|
||||
data.__isComponentClass = nil
|
||||
|
||||
return data
|
||||
end
|
||||
|
||||
function Component:deserialize(data) -- luacheck: ignore
|
||||
function Component:deserialize(data)
|
||||
Utils.shallowCopy(data, self)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue