Commit 66b3116 blut
committed
1 parent b66cf10 commit 66b3116 Copy full SHA for 66b3116
File tree 1 file changed +1
-14
lines changed
1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -115,27 +115,14 @@ local function piston_off(pos, node)
115
115
end
116
116
end
117
117
118
- local orientations = {
119
- [0 ] = { 4 , 8 },
120
- {13 , 17 },
121
- {10 , 6 },
122
- {20 , 15 },
123
- }
124
-
125
118
local function piston_orientate (pos , placer )
126
119
mesecon .mvps_set_owner (pos , placer )
127
120
if not placer then
128
121
return
129
122
end
130
123
local pitch = math.deg (placer :get_look_vertical ())
131
124
local node = minetest .get_node (pos )
132
- if pitch > 55 then
133
- node .param2 = orientations [node .param2 ][1 ]
134
- elseif pitch < - 55 then
135
- node .param2 = orientations [node .param2 ][2 ]
136
- else
137
- return
138
- end
125
+ node .param2 = core .dir_to_facedir (placer :get_look_dir (), true )
139
126
minetest .swap_node (pos , node )
140
127
-- minetest.after, because on_placenode for unoriented piston must be processed first
141
128
minetest .after (0 , mesecon .on_placenode , pos , node )
You can’t perform that action at this time.
0 commit comments