From 16c77c6a66ee85e2244bcea3cfee3e42a532765f Mon Sep 17 00:00:00 2001 From: flamendless Date: Tue, 14 Feb 2023 18:18:42 -0300 Subject: [PATCH] Fixed bug with serialization/deserialization --- concord/builtins/key.lua | 6 +++--- concord/world.lua | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/concord/builtins/key.lua b/concord/builtins/key.lua index f083bd4..7e571ed 100644 --- a/concord/builtins/key.lua +++ b/concord/builtins/key.lua @@ -19,7 +19,7 @@ local Key = Component("key", function (self, key) end) function Key:deserialize (data) - self.value = getKey(self, data.value) + self.value = getKey(self, data) end function Key:removed (replaced) @@ -28,10 +28,10 @@ function Key:removed (replaced) if entity:inWorld() then local world = entity:getWorld() - + return world:__clearKey(entity) end end end -return Key \ No newline at end of file +return Key diff --git a/concord/world.lua b/concord/world.lua index fc26e19..9303fe0 100644 --- a/concord/world.lua +++ b/concord/world.lua @@ -398,7 +398,8 @@ function World:deserialize(data, startClean, ignoreGenerator) if data[i].key then local component = Components.key:__new(entity) - entity.key = component:deserialize(data[i].key) + component:deserialize(data[i].key) + entity.key = component entity:__dirty() end