Skip to content

Commit 00123ee

Browse files
juhdanadparamat
authored andcommittedFeb 18, 2017
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.
1 parent 111e7e1 commit 00123ee

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed
 

Diff for: ‎builtin/game/falling.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ end
134134
function builtin_shared.check_attached_node(p, n)
135135
local def = core.registered_nodes[n.name]
136136
local d = {x = 0, y = 0, z = 0}
137-
if def.paramtype2 == "wallmounted" then
137+
if def.paramtype2 == "wallmounted" or
138+
def.paramtype2 == "colorwallmounted" then
138139
-- The fallback vector here is in case 'wallmounted to dir' is nil due
139140
-- to voxelmanip placing a wallmounted node without resetting a
140141
-- pre-existing param2 value that is out-of-range for wallmounted.

Diff for: ‎builtin/game/item.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,17 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2)
262262
-- Calculate direction for wall mounted stuff like torches and signs
263263
if def.place_param2 ~= nil then
264264
newnode.param2 = def.place_param2
265-
elseif def.paramtype2 == 'wallmounted' and not param2 then
265+
elseif (def.paramtype2 == 'wallmounted' or
266+
def.paramtype2 == 'colorwallmounted') and not param2 then
266267
local dir = {
267268
x = under.x - above.x,
268269
y = under.y - above.y,
269270
z = under.z - above.z
270271
}
271272
newnode.param2 = core.dir_to_wallmounted(dir)
272273
-- Calculate the direction for furnaces and chests and stuff
273-
elseif def.paramtype2 == 'facedir' and not param2 then
274+
elseif (def.paramtype2 == 'facedir' or
275+
def.paramtype2 == 'colorfacedir') and not param2 then
274276
local placer_pos = placer:getpos()
275277
if placer_pos then
276278
local dir = {

Diff for: ‎src/game.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,8 @@ bool nodePlacementPrediction(Client &client,
884884
};
885885
v3s16 pp;
886886

887-
if (nodedef->get(id).param_type_2 == CPT2_WALLMOUNTED)
887+
if (nodedef->get(id).param_type_2 == CPT2_WALLMOUNTED ||
888+
nodedef->get(id).param_type_2 == CPT2_COLORED_WALLMOUNTED)
888889
pp = p + wallmounted_dirs[param2];
889890
else
890891
pp = p + v3s16(0, -1, 0);

0 commit comments

Comments
 (0)
Please sign in to comment.