mirror of
https://github.com/minetest-mods/ropes.git
synced 2024-11-28 10:23:44 +01:00
bugfix init.lua:104: attempt to call method 'get_wielded_item' (a nil value)
This commit is contained in:
parent
ce479c8e6d
commit
5269e44b60
9
init.lua
9
init.lua
@ -101,14 +101,13 @@ minetest.register_node("vines:side", {
|
|||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
},
|
},
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
||||||
local wielded = user:get_wielded_item()
|
local wielded if user:get_wielded_item() ~= nil then wielded = user:get_wielded_item() else return end
|
||||||
if 'vines:shears' == wielded:get_name() then
|
if 'vines:shears' == wielded:get_name() then
|
||||||
local inv = user:get_inventory()
|
local inv = user:get_inventory()
|
||||||
if inv then
|
if inv then
|
||||||
inv:add_item("main", ItemStack(oldnode.name))
|
inv:add_item("main", ItemStack(oldnode.name))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
wielded:add_wear(65535/80)
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -147,14 +146,13 @@ minetest.register_node("vines:willow", {
|
|||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
},
|
},
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
||||||
local wielded = user:get_wielded_item()
|
local wielded if user:get_wielded_item() ~= nil then wielded = user:get_wielded_item() else return end
|
||||||
if 'vines:shears' == wielded:get_name() then
|
if 'vines:shears' == wielded:get_name() then
|
||||||
local inv = user:get_inventory()
|
local inv = user:get_inventory()
|
||||||
if inv then
|
if inv then
|
||||||
inv:add_item("main", ItemStack(oldnode.name))
|
inv:add_item("main", ItemStack(oldnode.name))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
wielded:add_wear(65535/80)
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -210,14 +208,13 @@ minetest.register_node("vines:vine", {
|
|||||||
fixed = {-0.3, -1/2, -0.3, 0.3, 1/2, 0.3},
|
fixed = {-0.3, -1/2, -0.3, 0.3, 1/2, 0.3},
|
||||||
},
|
},
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
||||||
local wielded = user:get_wielded_item()
|
local wielded if user:get_wielded_item() ~= nil then wielded = user:get_wielded_item() else return end
|
||||||
if 'vines:shears' == wielded:get_name() then
|
if 'vines:shears' == wielded:get_name() then
|
||||||
local inv = user:get_inventory()
|
local inv = user:get_inventory()
|
||||||
if inv then
|
if inv then
|
||||||
inv:add_item("main", ItemStack(oldnode.name))
|
inv:add_item("main", ItemStack(oldnode.name))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
wielded:add_wear(65535/80)
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user