diff options
author | Dániel Juhász <juhdanad@gmail.com> | 2017-02-18 20:26:19 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-02-18 22:47:24 +0000 |
commit | 00123ee04d19ecc98e0a6a9255e5697a78167360 (patch) | |
tree | 7b960732fde6ca3d3f5db4ae80c5332b3f80713b /builtin | |
parent | 111e7e1cc8316e4812e85fddc579feaeedecbb58 (diff) | |
download | minetest-00123ee04d19ecc98e0a6a9255e5697a78167360.tar.gz minetest-00123ee04d19ecc98e0a6a9255e5697a78167360.tar.bz2 minetest-00123ee04d19ecc98e0a6a9255e5697a78167360.zip |
Fixes for colorwallmounted and colorfacedir nodes
Correct node placement prediction for attached colorwallmounted nodes.
Correct placement direction for colorfacedir and colorwallmounted nodes.
Correct detatch mechanism for attached colorwallmounted nodes.
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/falling.lua | 3 | ||||
-rw-r--r-- | builtin/game/item.lua | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 39a74008c..5ef5289be 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -134,7 +134,8 @@ end function builtin_shared.check_attached_node(p, n) local def = core.registered_nodes[n.name] local d = {x = 0, y = 0, z = 0} - if def.paramtype2 == "wallmounted" then + if def.paramtype2 == "wallmounted" or + def.paramtype2 == "colorwallmounted" then -- The fallback vector here is in case 'wallmounted to dir' is nil due -- to voxelmanip placing a wallmounted node without resetting a -- pre-existing param2 value that is out-of-range for wallmounted. diff --git a/builtin/game/item.lua b/builtin/game/item.lua index a8dc51d61..38ef1714f 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -262,7 +262,8 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2) -- Calculate direction for wall mounted stuff like torches and signs if def.place_param2 ~= nil then newnode.param2 = def.place_param2 - elseif def.paramtype2 == 'wallmounted' and not param2 then + elseif (def.paramtype2 == 'wallmounted' or + def.paramtype2 == 'colorwallmounted') and not param2 then local dir = { x = under.x - above.x, y = under.y - above.y, @@ -270,7 +271,8 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2) } newnode.param2 = core.dir_to_wallmounted(dir) -- Calculate the direction for furnaces and chests and stuff - elseif def.paramtype2 == 'facedir' and not param2 then + elseif (def.paramtype2 == 'facedir' or + def.paramtype2 == 'colorfacedir') and not param2 then local placer_pos = placer:getpos() if placer_pos then local dir = { |