diff --git a/mods/beds/functions.lua b/mods/beds/functions.lua index 6e21bfc..5eefa5e 100644 --- a/mods/beds/functions.lua +++ b/mods/beds/functions.lua @@ -258,7 +258,7 @@ function beds.on_rightclick(pos, player) local ppos = player:get_pos() local tod = minetest.get_timeofday() - if tod > 0.2 and tod < 0.805 then + if tod > beds.day_interval.start and tod < beds.day_interval.finish then if beds.player[name] then lay_down(player, nil, nil, false) diff --git a/mods/beds/init.lua b/mods/beds/init.lua index 41a64e3..3ca476a 100644 --- a/mods/beds/init.lua +++ b/mods/beds/init.lua @@ -41,6 +41,11 @@ beds.is_50 = is_50 beds.is_53 = is_53 beds.is_54 = is_54 +beds.day_interval = { + start = 0.2, + finish = 0.805, +} + local modpath = minetest.get_modpath("beds") -- check for minetest 5.x/0.4 compatibility