mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-04-01 02:00:39 +02: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:
parent
fedc2c9433
commit
2e1803efe0
@ -69,8 +69,10 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
|||||||
if self.lastpos.x~=nil then
|
if self.lastpos.x~=nil then
|
||||||
if node.name ~= "air" then
|
if node.name ~= "air" then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
if node.diggable ~= false then
|
if minetest.get_item_group(node.name, "unbreakable") == 0
|
||||||
minetest.dig_node(pos)
|
and areas:canInteract(self.lastpos, self.player:get_player_name())
|
||||||
|
and node.diggable ~= false then
|
||||||
|
minetest.set_node(pos, {name = "air"})
|
||||||
end
|
end
|
||||||
local toughness = 0.65
|
local toughness = 0.65
|
||||||
if math.random() < toughness then
|
if math.random() < toughness then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user