self destruct book entity when table gone

This commit is contained in:
cora 2021-12-29 02:39:37 +01:00
parent 6ca6da2da0
commit 6142453658
1 changed files with 7 additions and 0 deletions

View File

@ -213,6 +213,13 @@ minetest.register_entity("mcl_enchanting:book", {
end
self._player_near = player_near
mcl_enchanting.check_animation_schedule(self, dtime)
if self._table_pos then
local tn=minetest.get_node_or_nil(self._table_pos)
if tn and tn.name ~= "mcl_enchanting:table" then
self.object:remove()
end
end
end,
})