Skip to content

Commit 57eb72d

Browse files
committed
better nodebox -> unrotated = param2==0
1 parent 3eca5fc commit 57eb72d

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

mesecons_extrawires/vertical.lua

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ local bottom_box = {
1616
}
1717
}
1818

19+
-- like bottom_box, but mirrored iny y-direction because of wallmounted
20+
local static_middle_box = {
21+
type = "fixed",
22+
fixed = {
23+
{-8/16, 7/16, -8/16, 8/16, 8/16, 8/16},
24+
{-1/16, -8/16, -1/16, 1/16, 7/16, 1/16},
25+
}
26+
}
27+
1928
local vertical_rules = {
2029
{x=0, y=1, z=0},
2130
{x=0, y=-1, z=0}
@@ -41,7 +50,7 @@ local bottom_rules = {
4150
local static_middle_rules = {}
4251
do
4352
-- not rotated, plate can connect to normal wire
44-
static_middle_rules[1] = {
53+
static_middle_rules[0] = {
4554
{x=1, y=0, z=0},
4655
{x=-1, y=0, z=0},
4756
{x=0, y=0, z=1},
@@ -57,11 +66,11 @@ do
5766
{x=0, y=2, z=0}, -- receive power from pressure plate / detector / ... 2 nodes above
5867
{x=0, y=-1, z=0},
5968
})
60-
static_middle_rules[0] = mesecon.rotate_rules_up(r)
61-
static_middle_rules[2] = mesecon.rotate_rules_left(mesecon.rotate_rules_left(r))
62-
static_middle_rules[3] = r
63-
static_middle_rules[4] = mesecon.rotate_rules_left(r)
64-
static_middle_rules[5] = mesecon.rotate_rules_right(r)
69+
static_middle_rules[1] = mesecon.rotate_rules_up(r)
70+
static_middle_rules[2] = r
71+
static_middle_rules[3] = mesecon.rotate_rules_left(mesecon.rotate_rules_left(r))
72+
static_middle_rules[4] = mesecon.rotate_rules_right(r)
73+
static_middle_rules[5] = mesecon.rotate_rules_left(r)
6574
end
6675
local function static_middle_rules_get(node)
6776
return static_middle_rules[node.param2] or {}
@@ -77,7 +86,7 @@ local function is_vertical_conductor(node)
7786
node.name ~= "mesecons_extrawires:vertical_static_middle_on" then
7887
return is_dynamic_vertical_wire(node)
7988
end
80-
return node.param2 == 1 or node.param2 == 0
89+
return node.param2 == 0 or node.param2 == 1
8190
end
8291

8392
local function vertical_updatepos(pos)
@@ -221,12 +230,12 @@ mesecon.register_node("mesecons_extrawires:vertical_static_middle", {
221230
walkable = false,
222231
paramtype = "light",
223232
paramtype2 = "wallmounted", -- yes, rotatable
224-
place_param2 = 1, -- but no automatic rotation
233+
place_param2 = 0, -- but no automatic rotation
225234
node_placement_prediction = "", -- also no client-side automatic rotation
226235
is_ground_content = false,
227236
sunlight_propagates = true,
228-
selection_box = bottom_box,
229-
node_box = bottom_box,
237+
selection_box = static_middle_box,
238+
node_box = static_middle_box,
230239
after_place_node = vertical_update,
231240
after_dig_node = vertical_update,
232241
sounds = default.node_sound_defaults(),

0 commit comments

Comments
 (0)