forked from mtcontrib/farming
add some nil checks for itemstack when right clicking on_rightclick nodes
This commit is contained in:
parent
faed117a6d
commit
d780097a48
@ -27,7 +27,7 @@ local function place_beans(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- am I right-clicking on something that has a custom on_place set?
|
-- am I right-clicking on something that has a custom on_place set?
|
||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- am I right-clicking on something that has a custom on_place set?
|
-- am I right-clicking on something that has a custom on_place set?
|
||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ local function place_grapes(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- am I right-clicking on something that has a custom on_place set?
|
-- am I right-clicking on something that has a custom on_place set?
|
||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
2
init.lua
2
init.lua
@ -421,7 +421,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
|
|||||||
-- am I right-clicking on something that has a custom on_place set?
|
-- am I right-clicking on something that has a custom on_place set?
|
||||||
-- thanks to Krock for helping with this issue :)
|
-- thanks to Krock for helping with this issue :)
|
||||||
local def = minetest.registered_nodes[under.name]
|
local def = minetest.registered_nodes[under.name]
|
||||||
if placer and def and def.on_rightclick then
|
if placer and itemstack and def and def.on_rightclick then
|
||||||
return def.on_rightclick(pt.under, under, placer, itemstack)
|
return def.on_rightclick(pt.under, under, placer, itemstack)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user