From 67c8a248381b61362b84e863566abe9a15d56e39 Mon Sep 17 00:00:00 2001 From: Zughy <4279489-marco_a@users.noreply.gitlab.com> Date: Fri, 23 Jun 2023 18:59:31 +0200 Subject: [PATCH] Don't speed up players when they zoom out and they have no stamina left --- src/weapons/weapons.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/weapons/weapons.lua b/src/weapons/weapons.lua index bc855c7..2979243 100644 --- a/src/weapons/weapons.lua +++ b/src/weapons/weapons.lua @@ -281,13 +281,17 @@ function block_league.deactivate_zoom(player) --TODO: rimuovere HUD zoom armi player:set_fov(0, nil, 0.1) + local p_name = player:get_player_name() + -- TODO: mettere FOV personalizzato così da evitare questo controllo; essendo un -- FPS, è più che sensato - if not arena_lib.is_player_in_arena(player:get_player_name()) then return end + if not arena_lib.is_player_in_arena(p_name) then return end local p_meta = player:get_meta() + local arena = arena_lib.get_arena_by_player(p_name) - if p_meta:get_int("bl_weapon_state") == 0 and + if arena.players[p_name].stamina > 0 and + p_meta:get_int("bl_weapon_state") == 0 and p_meta:get_int("bl_is_speed_locked") == 0 then player:set_physics_override({speed = block_league.SPEED}) end