summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2020-04-28 13:59:29 -0500
committercheapie <no-email-for-you@example.com>2020-04-28 13:59:29 -0500
commitcc15039eb68deee91582d2683f0471c0e37ddbfb (patch)
treee6d6195898115cd93c705cef01f586ef2116ed0c
parent35fc6cd5e1964487924f5d2fe9007ea26b34edbe (diff)
downloadareasprotector-cc15039eb68deee91582d2683f0471c0e37ddbfb.tar
areasprotector-cc15039eb68deee91582d2683f0471c0e37ddbfb.tar.gz
areasprotector-cc15039eb68deee91582d2683f0471c0e37ddbfb.tar.bz2
areasprotector-cc15039eb68deee91582d2683f0471c0e37ddbfb.tar.xz
areasprotector-cc15039eb68deee91582d2683f0471c0e37ddbfb.zip
Fix crashes in settings handling
-rw-r--r--init.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 82e4a79..0c2018c 100644
--- a/init.lua
+++ b/init.lua
@@ -11,21 +11,31 @@ end
local radius_large = minetest.settings:get("areasprotector_radius_large")
or minetest.settings:get("areasprotector_radius")
or 16
+
+radius_large = tonumber(radius_large) or 16
local height_large = minetest.settings:get("areasprotector_height_large")
or minetest.settings:get("areasprotector_radius_large")
or minetest.settings:get("areasprotector_radius")
or 16
+
+height_large = tonumber(height_large) or 16
local radius_small = minetest.settings:get("areasprotector_radius_small")
or 7
+
+radius_small = tonumber(radius_small) or 7
local height_small = minetest.settings:get("areasprotector_height_small")
or minetest.settings:get("areasprotector_radius_small")
or 7
+height_small = tonumber(height_small) or 7
+
local max_protectors = minetest.settings:get("areasprotector_max_protectors") or 16
+max_protectors = tonumber(max_protectors) or 16
+
local function remove_display(pos)
local objs = minetest.get_objects_inside_radius(pos, 0.5)
for _,o in pairs(objs) do