mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-17 05:57:30 +01:00
Implement mcl_util.remove_entity() and convert projectile code to use it
This commit is contained in:
parent
5b7c1a8d4c
commit
c1691e65a8
@ -753,3 +753,12 @@ function mcl_util.remove_entity(luaentity)
|
||||
|
||||
luaentity.object:remove()
|
||||
end
|
||||
function mcl_util.remove_entity(luaentity)
|
||||
if luaentity._removed then return end
|
||||
luaentity._removed = true
|
||||
|
||||
local hook = luaentity._on_remove
|
||||
if hook then hook(luaentity) end
|
||||
|
||||
luaentity.object:remove()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user