Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Doors: Remove ..." and "Doors: Allow the screwdriver to ..."
This reverts commit 5e4a6e8, and
             commit 60cf3f8.

The original door API rewrite I posted had all rotation disabled using
the correct on_rotate() handler returning `false`. Two subsequent
changes attempting first to enable simple rotation and second disabling
that again changed the callback handler to a boolean `false`, which
is incorrect use in the screwdriver API, and actually allows rotation.

The proper way to disable rotation for facedir nodes it to use a full
callback handler that does `return false`.
  • Loading branch information
sofar committed Jan 16, 2017
1 parent 1470b9d commit 6dcf541
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mods/doors/init.lua
Expand Up @@ -376,7 +376,9 @@ function doors.register(name, def)
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
minetest.check_for_falling({x = pos.x, y = pos.y + 1, z = pos.z})
end
def.on_rotate = false
def.on_rotate = function(pos, node, user, mode, new_param2)
return false
end

if def.protected then
def.can_dig = can_dig_door
Expand Down

0 comments on commit 6dcf541

Please sign in to comment.