Fix 2 crashes
This commit is contained in:
parent
2eb1728d8b
commit
a56b8dc3ff
4
bag.lua
4
bag.lua
@ -80,8 +80,8 @@ local function on_place(itemstack, player, pointed_thing)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if selected_item then
|
local pos = edit.pointed_thing_to_pos(pointed_thing)
|
||||||
local pos = edit.pointed_thing_to_pos(pointed_thing)
|
if selected_item and pos then
|
||||||
edit.place_item_like_player(player, {name = selected_item}, pos)
|
edit.place_item_like_player(player, {name = selected_item}, pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -226,11 +226,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
local pos = vector.new(x, y, z)
|
local pos = vector.new(x, y, z)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local old_name = node.name
|
local old_name = node.name
|
||||||
node.name = item_string
|
|
||||||
if replace_source_nodes[old_name] then
|
if replace_source_nodes[old_name] then
|
||||||
if is_node then
|
if is_node then
|
||||||
|
node.name = name
|
||||||
minetest.swap_node(pos, node)
|
minetest.swap_node(pos, node)
|
||||||
else
|
else
|
||||||
|
node.name = item_string
|
||||||
edit.place_item_like_player(player, node, pos)
|
edit.place_item_like_player(player, node, pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user