Update 'mods/default/item_entity.lua'

This commit is contained in:
thunderdog1138 2020-07-15 21:15:18 +00:00
parent 69f9b68fd6
commit 061b2e8852
1 changed files with 8 additions and 4 deletions

View File

@ -39,16 +39,20 @@ local item = {
}) })
end, end,
on_step = function(self, dtime) on_step = function(self, dtime, ...)
builtin_item.on_step(self, dtime) builtin_item.on_step(self, dtime, ...)
if self.flammable then if self.flammable then
-- flammable, check for igniters -- flammable, check for igniters every 10 s
self.ignite_timer = (self.ignite_timer or 0) + dtime self.ignite_timer = (self.ignite_timer or 0) + dtime
if self.ignite_timer > 10 then if self.ignite_timer > 10 then
self.ignite_timer = 0 self.ignite_timer = 0
local node = minetest.get_node_or_nil(self.object:get_pos()) local pos = self.object:get_pos()
if pos == nil then
return -- object already deleted
end
local node = minetest.get_node_or_nil(pos)
if not node then if not node then
return return
end end