From 464f3781667442d608581f505b5f1589d2c762bb Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Sun, 25 Jan 2015 15:32:36 -0500 Subject: [PATCH] fix collision boxes on shutters --- homedecor/shutters.lua | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/homedecor/shutters.lua b/homedecor/shutters.lua index b7f592f8..4b357e55 100644 --- a/homedecor/shutters.lua +++ b/homedecor/shutters.lua @@ -16,25 +16,33 @@ local shutters = { {"white", "White"}, } +local shutter_cbox = { + type = "wallmounted", + wall_top = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 }, + wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 }, + wall_side = { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 }, +} + for i in ipairs(shutters) do local name = shutters[i][1] local desc = shutters[i][2] -homedecor.register("shutter_"..name, { - mesh = "homedecor_window_shutter.obj", - tiles = { "homedecor_window_shutter_"..name..".png" }, - description = S("Wooden Shutter ("..desc..")"), - inventory_image = "homedecor_window_shutter_"..name.."_inv.png", - wield_image = "homedecor_window_shutter_"..name.."_inv.png", - paramtype = "light", - paramtype2 = "wallmounted", - groups = { snappy = 3 }, - sounds = default.node_sound_wood_defaults(), - selection_box = { - type = "wallmounted", --- wall_side = { -0.5, -0.5, 0.44, 0.5, 0.5, 0.5 } - }, -}) + homedecor.register("shutter_"..name, { + mesh = "homedecor_window_shutter.obj", + tiles = { "homedecor_window_shutter_"..name..".png" }, + description = S("Wooden Shutter ("..desc..")"), + inventory_image = "homedecor_window_shutter_"..name.."_inv.png", + wield_image = "homedecor_window_shutter_"..name.."_inv.png", + paramtype = "light", + paramtype2 = "wallmounted", + groups = { snappy = 3 }, + sounds = default.node_sound_wood_defaults(), + selection_box = shutter_cbox, + node_box = shutter_cbox, + -- collision_box doesn't accept type="wallmounted", but node_box + -- does. Said nodeboxes create a custom collision box but are + -- invisible themselves because drawtype="mesh". + }) end minetest.register_alias("homedecor:shutter_purple", "homedecor:shutter_violet")