Skip to content

Commit 6dcf541

Browse files
committedJan 16, 2017
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`.
1 parent 1470b9d commit 6dcf541

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

Diff for: ‎mods/doors/init.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ function doors.register(name, def)
376376
minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z})
377377
minetest.check_for_falling({x = pos.x, y = pos.y + 1, z = pos.z})
378378
end
379-
def.on_rotate = false
379+
def.on_rotate = function(pos, node, user, mode, new_param2)
380+
return false
381+
end
380382

381383
if def.protected then
382384
def.can_dig = can_dig_door

0 commit comments

Comments
 (0)
Please sign in to comment.