Make sure that pointed thing is node when using treetap
This commit is contained in:
parent
8d48b3f9f5
commit
62246bf91b
@ -19,6 +19,9 @@ if industrialtest.mods.mclRubber then
|
||||
end
|
||||
|
||||
local function onTreetapUse(user,pointed)
|
||||
if pointed.type~="node" or not user or not user:is_player() then
|
||||
return false
|
||||
end
|
||||
local node=minetest.get_node_or_nil(pointed.under)
|
||||
if not node then
|
||||
return false
|
||||
@ -47,7 +50,7 @@ industrialtest.internal.unpackTableInto(industrialtest.Treetap,{
|
||||
})
|
||||
|
||||
function industrialtest.Treetap.use(self,itemstack,user,pointed)
|
||||
return pointed.type=="node" and user and user:is_player() and onTreetapUse(user,pointed)
|
||||
return onTreetapUse(user,pointed)
|
||||
end
|
||||
|
||||
industrialtest.Treetap:register()
|
||||
@ -73,7 +76,7 @@ industrialtest.internal.unpackTableInto(industrialtest.ElectricTreetap,{
|
||||
})
|
||||
|
||||
function industrialtest.ElectricTreetap.use(self,itemstack,user,pointed)
|
||||
return user and user:is_player() and onTreetapUse(user,pointed)
|
||||
return onTreetapUse(user,pointed)
|
||||
end
|
||||
|
||||
function industrialtest.ElectricTreetap.getOpPower(self,itemstack)
|
||||
|
Loading…
x
Reference in New Issue
Block a user