From 61bc18cd31ac117a206a16574e5428632c02a9a0 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 19 Jun 2023 15:47:15 +1000 Subject: [PATCH] fix(server): adding and removing door properties Incorrect nil type-check when adding a new property. Allow empty string to remove a property. Resolves #146. --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index df282be3..14d70465 100644 --- a/server/main.lua +++ b/server/main.lua @@ -87,11 +87,11 @@ exports('editDoor', function(id, data) local t1 = type(current) local t2 = type(v) - if t1 ~= nil and t1 ~= t2 then + if t1 ~= 'nil' and v ~= '' and t1 ~= t2 then error(("Expected '%s' for door.%s, received %s (%s)"):format(t1, k, t2, v)) end - door[k] = v + door[k] = v ~= '' and v or nil end end