forked from VoxeLibre/VoxeLibre
Fix damage animation and player invul crash in mcl_playerplus
This commit is contained in:
parent
c31226041f
commit
127fd37034
|
@ -749,6 +749,8 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
|
||||||
if time_diff <= 500000 and time_diff >= 0 then
|
if time_diff <= 500000 and time_diff >= 0 then
|
||||||
player:get_meta():set_int("mcl_damage:invulnerable", 1)
|
player:get_meta():set_int("mcl_damage:invulnerable", 1)
|
||||||
minetest.after(0.5, function()
|
minetest.after(0.5, function()
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return end
|
||||||
player:get_meta():set_int("mcl_damage:invulnerable", 0)
|
player:get_meta():set_int("mcl_damage:invulnerable", 0)
|
||||||
end)
|
end)
|
||||||
damage = damage - mcl_playerplus_internal[name].last_damage
|
damage = damage - mcl_playerplus_internal[name].last_damage
|
||||||
|
@ -761,6 +763,8 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
|
||||||
mcl_playerplus_internal[name].invul_timestamp = time_now
|
mcl_playerplus_internal[name].invul_timestamp = time_now
|
||||||
player:get_meta():set_int("mcl_damage:damage_animation", 1)
|
player:get_meta():set_int("mcl_damage:damage_animation", 1)
|
||||||
minetest.after(0.5, function()
|
minetest.after(0.5, function()
|
||||||
|
local player = minetest.get_player_by_name(name)
|
||||||
|
if not player then return end
|
||||||
player:get_meta():set_int("mcl_damage:damage_animation", 0)
|
player:get_meta():set_int("mcl_damage:damage_animation", 0)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue