From d2cacf285d03dc23faf94bf80959e948c6fb7577 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 21 May 2020 04:44:14 +0200 Subject: [PATCH] Paintings: Tweak selectionboxes --- mods/ENTITIES/mcl_paintings/init.lua | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/mods/ENTITIES/mcl_paintings/init.lua b/mods/ENTITIES/mcl_paintings/init.lua index 06a9023546..ea52ae1734 100644 --- a/mods/ENTITIES/mcl_paintings/init.lua +++ b/mods/ENTITIES/mcl_paintings/init.lua @@ -105,19 +105,22 @@ local set_entity = function(object) ..xsize..","..ysize..", motive number "..ent._motive.."!") return end - if wallm == 4 or wallm == 5 then - object:set_properties({ - selectionbox = { exmin, eymin, -1/64, exmax, eymax, 1/64 }, - visual_size = visual_size, - textures = { wood, wood, wood, wood, painting, wood }, - }) - else - object:set_properties({ - selectionbox = { -1/64, eymin, exmin, 1/64, eymax, exmax }, - visual_size = visual_size, - textures = { wood, wood, wood, wood, painting, wood }, - }) + local box + if wallm == 2 then + box = { -3/128, eymin, exmin, 1/64, eymax, exmax } + elseif wallm == 3 then + box = { -1/64, eymin, exmin, 3/128, eymax, exmax } + elseif wallm == 4 then + box = { exmin, eymin, -3/128, exmax, eymax, 1/64 } + elseif wallm == 5 then + box = { exmin, eymin, -1/64, exmax, eymax, 3/128 } end + object:set_properties({ + selectionbox = box, + visual_size = visual_size, + textures = { wood, wood, wood, wood, painting, wood }, + }) + local dir = minetest.wallmounted_to_dir(wallm) if not dir then return