Fix node placement with pencil in write mode

This commit is contained in:
Jordan Irwin 2021-07-31 13:30:14 -07:00
parent 28f1f355c0
commit fd6032a879
2 changed files with 1 additions and 2 deletions

View file

@ -7,6 +7,5 @@ TODO:
- add LBM when removing an item if it is a node
- add "radius" option for pencil or "xlen", "ylen", & "zlen" options
- add "xrotate" & "zrorate" modes for pencil
- fix pencil "write" mode when pointing to side of node (node gets placed below)
- don't require "server" priv for "find_unknown_nodes" & "find_neaby_nodes" commands
- add chat command to find nodes with specified attributes

View file

@ -184,7 +184,7 @@ tool.on_use = function(stack, user, pointed_thing)
elseif mode == "write" then
local node_above = core.get_node_or_nil(pointed_thing.above)
if not node_above or node_above.name == "air" then
core.place_node(pointed_thing.above, {name=new_node_name})
core.set_node(pointed_thing.above, {name=new_node_name})
sound_handle = core.sound_play("cleaner_pencil_write", {object=user})
else
core.chat_send_player(pname, S("Can't place node there."))