forked from MineClone5/MineClone5
Merge pull request 'ITEMS/mcl_shields: fix runaway IO and unnecessary network traffic.' (#144) from fix-shield-io into master
Reviewed-on: MineClone5/MineClone5#144
This commit is contained in:
commit
fb99cc5abe
|
@ -182,8 +182,10 @@ end
|
|||
local function set_interact(player, interact)
|
||||
local player_name = player:get_player_name()
|
||||
local privs = minetest.get_player_privs(player_name)
|
||||
privs.interact = interact
|
||||
minetest.set_player_privs(player_name, privs)
|
||||
if privs.interact ~= interact then
|
||||
privs.interact = interact
|
||||
minetest.set_player_privs(player_name, privs)
|
||||
end
|
||||
end
|
||||
|
||||
local shield_hud = {}
|
||||
|
@ -195,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
|
||||
|
|
Loading…
Reference in New Issue