From 9e1b11a52c072893a0e3a5d30815ce18ee2607eb Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Sun, 4 Jun 2017 11:59:15 -0700 Subject: [PATCH] Fix converting setting types to integer --- spawn.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spawn.lua b/spawn.lua index a8a2577..45f0880 100644 --- a/spawn.lua +++ b/spawn.lua @@ -5,10 +5,10 @@ local time_min = 60 local time_hr = time_min * 60 local time_day = time_hr * 24 -local spawn_cap = minetest.setting_get('sneeker.spawn_cap') or 10 -- Maximum number of spawns active at one time -local spawn_chance = minetest.setting_get('sneeker.spawn_chance') or 1000 -- 1/1000 chance of spawn -local spawn_interval = minetest.setting_get('sneeker.spawn_interval') or time_min * 4 -- Default interval is 4 minutes -local spawn_maxlight = minetest.setting_get('sneeker.spawn_maxlight') or 5 -- Maximum light of node for spawn +local spawn_cap = tonumber(minetest.setting_get('sneeker.spawn_cap')) or 10 -- Maximum number of spawns active at one time +local spawn_chance = tonumber(minetest.setting_get('sneeker.spawn_chance')) or 1000 -- 1/1000 chance of spawn +local spawn_interval = tonumber(minetest.setting_get('sneeker.spawn_interval')) or time_min * 4 -- Default interval is 4 minutes +local spawn_maxlight = tonumber(minetest.setting_get('sneeker.spawn_maxlight')) or 5 -- Maximum light of node for spawn local spawn_chance_percent = tostring(math.floor(1 / spawn_chance * 100)) .. '%'