1
0
mirror of https://github.com/Sokomine/cottages.git synced 2026-01-12 20:15:42 +01:00

Merge branch 'tour-sitting'

Fixed not beeing able to right-click when sitting already (and thus not
beeing able to get up again).
This commit is contained in:
Sokomine
2025-11-16 14:46:45 +01:00

View File

@@ -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});