From a4297e8c2e5068e5151729fc9150c4d08f4c2c72 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 16 Nov 2025 14:45:38 +0100 Subject: [PATCH] fixed allow_sit so that a second right-click on what we're sitting at works again and players can get up again --- nodes_furniture.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nodes_furniture.lua b/nodes_furniture.lua index 2175e99..bb5e8dd 100644 --- a/nodes_furniture.lua +++ b/nodes_furniture.lua @@ -377,8 +377,13 @@ cottages.allow_sit = function( player, pos ) local pname = player:get_player_name() if player_api.player_attached[pname] then - -- another mod controls the player, we might break it's logic - return false + -- it is possible that the player is sitting and wants to lie down or get up + d = vector.distance(pos, player:get_pos()) + if(d > 1.1) then + -- the player is sitting - but not on this object that was right-clicked; + -- someone else is responsible for handling this click + return false + end end local p_above = minetest.get_node( {x=pos.x, y=pos.y+1, z=pos.z});