mobs-redo #2

Merged
SumianVoice merged 457 commits from VoxeLibre/VoxeLibre:mobs-redo into mobs-redo 2022-07-20 00:23:43 +02:00
1 changed files with 13 additions and 9 deletions
Showing only changes of commit 3c2633ee2c - Show all commits

View File

@ -119,23 +119,27 @@ minetest.register_craft({
}
})
local function burn_in_campfire(obj)
local p = obj:get_pos()
if p then
local n = minetest.find_node_near(p,0.4,{"group:lit_campfire"},true)
if n then
mcl_burning.set_on_fire(obj, 5)
end
end
end
local etime = 0
minetest.register_globalstep(function(dtime)
etime = dtime + etime
if etime < 0.5 then return end
etime = 0
for _,pl in pairs(minetest.get_connected_players()) do
local n = minetest.find_node_near(pl:get_pos(),0.4,{"group:lit_campfire"},true)
if n then
mcl_burning.set_on_fire(pl, 5)
end
burn_in_campfire(pl)
end
for _,ent in pairs(minetest.luaentities) do
if ent.object:get_pos() and ent.is_mob then
local n = minetest.find_node_near(ent.object:get_pos(),0.4,{"group:lit_campfire"},true)
if n then
mcl_burning.set_on_fire(ent.object, 5)
end
if ent.is_mob then
burn_in_campfire(ent.object)
end
end
end)