Lower and unify distance check

This commit is contained in:
cora 2022-11-25 00:25:45 +01:00
parent d0ea7c4059
commit dabc09adb2
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ end
local function addbars(self)
if not self.enable_bossbar then return end
for _,player in pairs(minetest.get_connected_players()) do
if vector.distance(self.pos,player:get_pos()) < 75 then
if vector.distance(self.pos,player:get_pos()) < 64 then
local bar = mcl_bossbars.add_bar(player, {color = "red", text = self.readable_name .. ": Wave "..self.stage.." / "..self.max_stage, percentage = self.percent }, true,1)
table.insert(self.bars,bar)
end
@ -120,7 +120,7 @@ function check_events(dtime)
for idx,ae in pairs(active_events) do
local player_near = false
for _,pl in pairs(minetest.get_connected_players()) do
if ae.pos and vector.distance(pl:get_pos(),ae.pos) < 150 then player_near = true end
if ae.pos and vector.distance(pl:get_pos(),ae.pos) < 64 then player_near = true end
end
if ae.pos and not player_near then
mcl_log("[mcl_events] Event "..ae.readable_name.." at "..minetest.pos_to_string(vector.round(ae.pos)).." aborted - no players near." )