mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Improve mcl_bossbars performance
This commit is contained in:
parent
d77affca91
commit
cbd2731e06
1 changed files with 4 additions and 3 deletions
|
@ -86,9 +86,10 @@ function mcl_bossbars.update_boss(luaentity, name, color)
|
||||||
if not bardef.text or bardef.text == "" then
|
if not bardef.text or bardef.text == "" then
|
||||||
bardef.text = name
|
bardef.text = name
|
||||||
end
|
end
|
||||||
for _, obj in pairs(minetest.get_objects_inside_radius(object:get_pos(), 128)) do
|
local pos = object:get_pos()
|
||||||
if obj:is_player() then
|
for _, player in pairs(minetest.get_connected_players()) do
|
||||||
mcl_bossbars.add_bar(obj, bardef)
|
if vector.distance(pos, player:get_pos()) <= 80 then
|
||||||
|
mcl_bossbars.add_bar(player, bardef)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue