Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on_punch = function(pos, node, puncher, pointed_thing)
- if puncher:is_player() then
- print(puncher:get_player_name() .. " pounded the alarm at ")
- print(pos)
- end
- local setchan = minetest.get_meta(pos):get_string("channel")
- rules = {{x=0, y=0, z=-1}, -- taken from digilines.default.rules thing
- {x=1, y=0, z=0},
- {x=-1, y=0, z=0},
- {x=0, y=0, z=1},
- {x=1, y=1, z=0},
- {x=1, y=-1, z=0},
- {x=-1, y=1, z=0},
- {x=-1, y=-1, z=0},
- {x=0, y=1, z=1},
- {x=0, y=-1, z=1},
- {x=0, y=1, z=-1},
- {x=0, y=-1, z=-1}}
- digilines:receptor_send(pos, rules, setchan, "fire")
- -- TODO: store the name of the puncher in somewhere permanent
- end,
- -- Breaks and gives:
- AsyncErr: Lua: Runtime error from mod 'firesafety' in callback node_on_punch(): /tmp/.mount_MineteFpGKBh/usr/bin/../builtin/game/misc_s.lua:13: attempt to perform arithmetic on field 'z' (a nil value)
- stack traceback:
- /tmp/.mount_MineteFpGKBh/usr/bin/../builtin/game/misc_s.lua:13: in function 'hash_node_position'
- /home/independent/.minetest/mods/digilines/init.lua:50: in function 'receptor_send'
- ...dent/.minetest/mods/mymods/fire_safety_new/fireboxes.lua:57: in function <...dent/.minetest/mods/mymods/fire_safety_new/fireboxes.lua:36>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement