From 09d4123317887ecf6831198010db13e557dd1f0d Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 27 Oct 2024 11:56:08 -0400 Subject: [PATCH] fix sofas --- homedecor_seating/init.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/homedecor_seating/init.lua b/homedecor_seating/init.lua index 0c883807..22c65c66 100644 --- a/homedecor_seating/init.lua +++ b/homedecor_seating/init.lua @@ -158,11 +158,26 @@ function lrfurn.sit(pos, node, clicker, itemstack, pointed_thing, seats) 0*math.pi/180, } + local p2r_sofa = { + 0*math.pi/180, + 90*math.pi/180, --correct + 270*math.pi/180, --correct + 180*math.pi/180, --correct + 0*math.pi/180, --correct + 0*math.pi/180, + 0*math.pi/180, + 0*math.pi/180, + } + local entity = minetest.add_entity(sit_pos, "homedecor_seating:seat") if not entity then return itemstack end --catch for when the entity fails to spawn just in case clicker:set_attach(entity, "", {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}, true) - entity:set_rotation({x = 0, y = p2r[node.param2 % 8], z = 0}) + if string.find(node.name, "sofa") then + entity:set_rotation({x = 0, y = p2r_sofa[node.param2 % 8], z = 0}) + else + entity:set_rotation({x = 0, y = p2r[node.param2 % 8], z = 0}) + end xcompat.player.player_attached[name] = true xcompat.player.set_animation(clicker, "sit", 0)