forked from MineClone5/MineClone5
Fix #1746 (make anvils destroy items when falling)
This commit is contained in:
parent
a9ceeabc4b
commit
21992dc265
|
@ -276,6 +276,12 @@ local function damage_anvil_by_using(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function damage_anvil_by_falling(pos, distance)
|
local function damage_anvil_by_falling(pos, distance)
|
||||||
|
for _,object in pairs(minetest.get_objects_inside_radius(pos, 0.8)) do
|
||||||
|
local entity = object:get_luaentity()
|
||||||
|
if not object:is_player() and entity and entity.name == "__builtin:item" then
|
||||||
|
object:remove()
|
||||||
|
end
|
||||||
|
end
|
||||||
local r = math.random(1, 100)
|
local r = math.random(1, 100)
|
||||||
if distance > 1 then
|
if distance > 1 then
|
||||||
if r <= (5*distance) then
|
if r <= (5*distance) then
|
||||||
|
|
Loading…
Reference in New Issue