Check for attachments

This commit is contained in:
ElCeejo 2021-04-10 12:56:46 -07:00 committed by GitHub
parent 42baede13f
commit 84df4274cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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