TD: scoring will now speed up the player who scored (if normal conditions are met)

This commit is contained in:
marco_a 2024-03-24 13:01:11 +01:00
parent 1815069874
commit da505afb23

View File

@ -38,6 +38,18 @@ local ball = {
-- eseguito quando l'entità viene distrutta
function ball:_destroy()
-- se era attaccata a qualcunə (punto)
if self._p_name then
local wielder = minetest.get_player_by_name(self._p_name)
local p_meta = wielder:get_meta()
if p_meta:get_int("wl_is_speed_locked") == 0
and p_meta:get_int("wl_zooming") == 0
and p_meta:get_int("wl_weapon_state") == 0 then
wielder:set_physics_override({speed = block_league.SPEED})
end
end
self.object:remove()
end
@ -370,10 +382,6 @@ function after_point(teamID, arena)
-- disabilita le armi e interrompi spari vari
arena.weapons_disabled = true
for pl_name, _ in pairs(arena.players) do
weapons_lib.reset_state(minetest.get_player_by_name(pl_name))
end
-- se rimane troppo poco tempo, aspetta la fine della partita
if arena.current_time <= 6 then return end