From 182b51be93dfe207f022f8b4b6194b88e9f0f775 Mon Sep 17 00:00:00 2001 From: theFox6 Date: Tue, 10 Apr 2018 19:14:19 +0200 Subject: [PATCH] tables need to be serialized --- weather/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weather/init.lua b/weather/init.lua index 9331bec..dd5c43e 100644 --- a/weather/init.lua +++ b/weather/init.lua @@ -11,14 +11,14 @@ end save_weather = function () local file = io.open(minetest.get_worldpath().."/weather", "w+") - file:write(weather) + file:write(minetest.serialize(weather)) file:close() end read_weather = function () local file = io.open(minetest.get_worldpath().."/weather", "r") if not file then return {type = "none", wind = 0} end - local readweather = file:read() + local readweather = minetest.deserialize(file:read()) file:close() if type(readweather)~="table" then return {type = "none", wind = 0}