mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-12-20 16:55:19 +01:00
fixed mores bug in throwing mod
enable dig_arrow
This commit is contained in:
@@ -38,6 +38,9 @@ local THROWING_ARROW_ENTITY={
|
||||
lastpos={},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
node = "",
|
||||
player = "",
|
||||
inventory = false,
|
||||
stack = false,
|
||||
}
|
||||
|
||||
THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
@@ -50,7 +53,6 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= "throwing:arrow_build_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
self.object:remove()
|
||||
if self.inventory and self.stack and not minetest.setting_getbool("creative_mode") then
|
||||
self.inventory:remove_item("main", {name=self.stack:get_name()})
|
||||
end
|
||||
@@ -63,6 +65,8 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
else
|
||||
minetest.add_item(self.lastpos, 'default:stick')
|
||||
end
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -70,18 +74,18 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
|
||||
if self.lastpos.x~=nil then
|
||||
if node.name ~= "air" then
|
||||
self.object:remove()
|
||||
if self.inventory and self.stack and not minetest.setting_getbool("creative_mode") then
|
||||
self.inventory:remove_item("main", {name=self.stack:get_name()})
|
||||
self.inventory:remove_item("main", {name=self.stack:get_name()})
|
||||
end
|
||||
if self.stack then
|
||||
if not string.find(node.name, "water") and not string.find(node.name, "lava") and not string.find(node.name, "torch") and self.stack:get_definition().type == "node" and self.stack:get_name() ~= "default:torch" then
|
||||
if not minetest.is_protected(self.lastpos, self.player) and not string.find(node.name, "water") and not string.find(node.name, "lava") and not string.find(node.name, "torch") and self.stack:get_definition().type == "node" and self.stack:get_name() ~= "default:torch" then
|
||||
minetest.place_node(self.lastpos, {name=self.stack:get_name()})
|
||||
else
|
||||
minetest.add_item(self.lastpos, {name=self.stack:get_name()})
|
||||
end
|
||||
end
|
||||
minetest.add_item(self.lastpos, 'default:shovel_steel')
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
|
||||
|
||||
Reference in New Issue
Block a user