mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-26 21:03:45 +01:00
Merge pull request 'Fix #1746 (make anvils destroy items when falling)' (#1830) from anvils into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/1830
commit
27f4c210c7
@ -19,7 +19,10 @@ local function deal_falling_damage(self, dtime)
|
|||||||
end
|
end
|
||||||
self._hit = self._hit or {}
|
self._hit = self._hit or {}
|
||||||
for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||||
if mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
|
local entity = obj:get_luaentity()
|
||||||
|
if entity and entity.name == "__builtin:item" then
|
||||||
|
obj:remove()
|
||||||
|
elseif mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
|
||||||
self._hit[obj] = true
|
self._hit[obj] = true
|
||||||
local way = self._startpos.y - pos.y
|
local way = self._startpos.y - pos.y
|
||||||
local damage = (way - 1) * 2
|
local damage = (way - 1) * 2
|
||||||
|
Loading…
Reference in New Issue
Block a user