Skip to content

Commit

Permalink
use get_buildable_to()
Browse files Browse the repository at this point in the history
Co-authored-by: SmallJoker <[email protected]>
  • Loading branch information
a-tour-ist and SmallJoker authored Nov 16, 2024
1 parent 64d0734 commit 02c8f4a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gate_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ local get_door_layout = function(pos, facedir, player)
if not vector.equals(door_node.pos, origin) then
-- There's no obstruction if the node is literally located along the rotation axis
local newpos = rotate_pos_displaced(door_node.pos, origin, axis, direction)
local newnode = minetest.get_node(newpos)
local newdef = minetest.registered_nodes[newnode.name]
if not (newdef and newdef.buildable_to) then
if get_buildable_to(newpos) then
-- check if the destination node is free.
door.swings[direction] = false
break
Expand Down

0 comments on commit 02c8f4a

Please sign in to comment.