From 84df4274cc26f3e9a7b38f83e2e06e598d405059 Mon Sep 17 00:00:00 2001 From: ElCeejo <40281901+ElCeejo@users.noreply.github.com> Date: Sat, 10 Apr 2021 12:56:46 -0700 Subject: [PATCH] Check for attachments --- mods/beds/functions.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/beds/functions.lua b/mods/beds/functions.lua index f0ddae7a..fa88680f 100644 --- a/mods/beds/functions.lua +++ b/mods/beds/functions.lua @@ -101,6 +101,11 @@ local function lay_down(player, pos, bed_pos, state, skip) minetest.chat_send_player(name, S("You have to stop moving before going to bed!")) return false end + + -- Check if player is attached to an object + if player:get_attach() then + return false + end if beds.player[name] then -- player already in bed, do nothing