1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

Update dig arrows to avoid digging nodes that shouldn't be dug

- Dig arrows now check for areas, .diggable, and unbreakables
This commit is contained in:
LeMagnesium 2015-07-08 14:03:55 +02:00
parent fedc2c9433
commit 2e1803efe0

View File

@ -69,8 +69,10 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
if self.lastpos.x~=nil then
if node.name ~= "air" then
self.object:remove()
if node.diggable ~= false then
minetest.dig_node(pos)
if minetest.get_item_group(node.name, "unbreakable") == 0
and areas:canInteract(self.lastpos, self.player:get_player_name())
and node.diggable ~= false then
minetest.set_node(pos, {name = "air"})
end
local toughness = 0.65
if math.random() < toughness then