Merge branch 'spectate_ball' into 'master'

Possibility to spectate the ball instead of players

Closes #54

See merge request zughy-friends-minetest/block_league!18
This commit is contained in:
Zughy 2022-05-25 21:28:28 +00:00
commit fed5577151
2 changed files with 5 additions and 1 deletions

View File

@ -142,7 +142,9 @@ arena_lib.on_change_spectated_target("block_league", function(arena, sp_name, ta
if type(target) ~= "string" then return end if type(target) ~= "string" then return end
-- ritardo di 0.1 perché on_join non è ancora stato chiamato, quindi non hanno ancora la HUD -- ritardo di 0.1 perché on_join non è ancora stato chiamato, quindi non hanno ancora la HUD
minetest.after(0.1, function() minetest.after(0.1, function()
block_league.HUD_energy_update(arena, target) if minetest.is_player(target) and target:get_hp() <= 0 then
block_league.HUD_energy_update(arena, target)
end
end) end)
end) end)

View File

@ -62,6 +62,8 @@ function ball:on_activate(staticdata, d_time)
return return
end end
arena_lib.add_spectable_target("block_league", arena.name, "entity", "Ball", self)
self.w_name = nil self.w_name = nil
self.timer_bool = false self.timer_bool = false
self.team_id = nil self.team_id = nil