mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-30 23:03:45 +01:00
Deduplicate shield slowdown removal code
This commit is contained in:
parent
d0d1217dec
commit
45ae170447
@ -240,6 +240,7 @@ local shield_hud = {}
|
|||||||
|
|
||||||
local function remove_shield_hud(player)
|
local function remove_shield_hud(player)
|
||||||
set_interact(player, true)
|
set_interact(player, true)
|
||||||
|
playerphysics.remove_physics_factor(player, "speed", "shield_speed")
|
||||||
|
|
||||||
if not shield_hud[player] then return end --this function takes a long time. only run it when necessary
|
if not shield_hud[player] then return end --this function takes a long time. only run it when necessary
|
||||||
player:hud_remove(shield_hud[player])
|
player:hud_remove(shield_hud[player])
|
||||||
@ -251,8 +252,6 @@ local function remove_shield_hud(player)
|
|||||||
if not hf.wielditem then
|
if not hf.wielditem then
|
||||||
player:hud_set_flags({wielditem = true})
|
player:hud_set_flags({wielditem = true})
|
||||||
end
|
end
|
||||||
|
|
||||||
playerphysics.remove_physics_factor(player, "speed", "shield_speed")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function add_shield_entity(player, i)
|
local function add_shield_entity(player, i)
|
||||||
|
Loading…
Reference in New Issue
Block a user