mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-29 18:16:27 -04:00
Update xpanes init.lua
Uses `minetest.swap_node` instead of `minetest.set_node`. Make rotation %2, since the panes look the same both ways.
This commit is contained in:
parent
e8097c9e87
commit
0622f544a2
1 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ local function swap(pos, node, name, param2)
|
|||
return
|
||||
end
|
||||
|
||||
minetest.set_node(pos, {name = name, param2 = param2})
|
||||
minetest.swap_node(pos, {name = name, param2 = param2})
|
||||
end
|
||||
|
||||
local function update_pane(pos)
|
||||
|
@ -54,10 +54,10 @@ local function update_pane(pos)
|
|||
if count == 0 then
|
||||
swap(pos, node, name .. "_flat", any)
|
||||
elseif count == 1 then
|
||||
swap(pos, node, name .. "_flat", (any + 1) % 4)
|
||||
swap(pos, node, name .. "_flat", (any + 1) % 2)
|
||||
elseif count == 2 then
|
||||
if (c[0] and c[2]) or (c[1] and c[3]) then
|
||||
swap(pos, node, name .. "_flat", (any + 1) % 4)
|
||||
swap(pos, node, name .. "_flat", (any + 1) % 2)
|
||||
else
|
||||
swap(pos, node, name, 0)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue