summaryrefslogtreecommitdiff
path: root/internal.lua
diff options
context:
space:
mode:
Diffstat (limited to 'internal.lua')
-rw-r--r--internal.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal.lua b/internal.lua
index 338187a..deba856 100644
--- a/internal.lua
+++ b/internal.lua
@@ -5,11 +5,16 @@ end
-- Save the areas table to a file
function areas:save()
+ local datastr = minetest.serialize(self.areas)
+ if not datastr then
+ minetest.log("error", "[areas] Failed to serialize area data!")
+ return
+ end
local file, err = io.open(self.filename, "w")
if err then
return err
end
- file:write(minetest.serialize(self.areas))
+ file:write(datastr)
file:close()
end