Skip to content

Commit 20fa037

Browse files
t4imrubenwardy
authored andcommittedAug 5, 2016
Screwdriver: disallow rotation with on_rotate = false
Other screwdriver mods, or mods that cause rotation, might operate without the screwdriver mod loaded and have `screwdriver.disallow` unavailable. This allows nodes to default to full-disallow rather than full-rotation in such a situation.
1 parent 60cf3f8 commit 20fa037

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎game_api.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ To use it, add the `on_screwdriver` function to the node definition.
348348
* `new_param2` the new value of param2 that would have been set if on_rotate wasn't there
349349
* return value: false to disallow rotation, nil to keep default behaviour, true to allow
350350
it but to indicate that changed have already been made (so the screwdriver will wear out)
351-
* use `on_rotate = screwdriver.disallow` to always disallow rotation
351+
* use `on_rotate = false` to always disallow rotation
352352
* use `on_rotate = screwdriver.rotate_simple` to allow only face rotation
353353

354354

‎mods/screwdriver/init.lua

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
6464
end
6565
else
6666
if not ndef or not ndef.paramtype2 == "facedir" or
67+
ndef.on_rotate == false or
6768
(ndef.drawtype == "nodebox" and
6869
not ndef.node_box.type == "fixed") or
6970
node.param2 == nil then

0 commit comments

Comments
 (0)
Please sign in to comment.