set hud flags only when changed

Setting hud flags (and other player properties) when they have not
changed results in unneccessary network traffic.
This commit is contained in:
cora 2022-01-30 01:08:32 +01:00
parent 8bfa248ef7
commit 5cda117073
1 changed files with 6 additions and 1 deletions

View File

@ -197,7 +197,12 @@ local function remove_shield_hud(player)
set_shield(player, false, 1)
set_shield(player, false, 2)
end
player:hud_set_flags({wielditem = true})
local hf=player:hud_get_flags()
if not hf.wielditem then
player:hud_set_flags({wielditem = true})
end
playerphysics.remove_physics_factor(player, "speed", "shield_speed")
set_interact(player, true)
end