summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@mirzakhani.gpcf.eu>2018-06-26 18:54:09 +0200
committerroot <root@mirzakhani.gpcf.eu>2018-06-26 18:54:09 +0200
commit217869f2c1109383aaeb753c130c333840b8078f (patch)
treedb52c42b0385a9509eecd4b0610d7c62d3a11a48
parentcb4d6b68f8b407d3ec9079dcd9195210ee5abd19 (diff)
parentea94718a9a4acb427c82f6ef6734a5e6c59a9bc4 (diff)
Merge branch 'master' of https://github.com/minetest-mods/pipeworks
-rw-r--r--wielder.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/wielder.lua b/wielder.lua
index 51ee278..eb7931f 100644
--- a/wielder.lua
+++ b/wielder.lua
@@ -28,7 +28,11 @@ local can_tool_dig_node = function(nodename, toolcaps, toolname)
-- diggable: boolean, can this tool dig this node at all
-- time: float, time needed to dig with this tool
-- wear: int, number of wear points to inflict on the item
- local nodegroups = minetest.registered_nodes[nodename].groups
+ local nodedef = minetest.registered_nodes[nodename]
+ -- don't explode due to nil def in event of unknown node!
+ if (nodedef == nil) then return false end
+
+ local nodegroups = nodedef.groups
local diggable = minetest.get_dig_params(nodegroups, toolcaps).diggable
if not diggable then
-- a pickaxe can't actually dig leaves based on it's groups alone,
@@ -99,6 +103,8 @@ local function wielder_on(data, wielder_pos, wielder_node)
get_look_dir = delay(vector.multiply(dir, -1)),
get_look_pitch = delay(pitch),
get_look_yaw = delay(yaw),
+ get_look_horizontal = delay(yaw),
+ get_look_vertical = delay(pitch),
get_player_control = delay({ jump=false, right=false, left=false, LMB=false, RMB=false, sneak=data.sneak, aux1=false, down=false, up=false }),
get_player_control_bits = delay(data.sneak and 64 or 0),
get_player_name = delay(data.masquerade_as_owner and wielder_meta:get_string("owner") or ":pipeworks:"..minetest.pos_to_string(wielder_pos)),