mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-29 14:01:07 +01:00
Fix a crash
Defensive check for nonexistent player
This commit is contained in:
parent
59c5d54cbe
commit
12b3e34f88
1 changed files with 3 additions and 0 deletions
|
@ -230,7 +230,10 @@ minetest.register_globalstep(function(dtime)
|
||||||
player_set_animation(player, "die")
|
player_set_animation(player, "die")
|
||||||
elseif player:get_meta():get_int("mcl_damage:damage_animation") > 0 then
|
elseif player:get_meta():get_int("mcl_damage:damage_animation") > 0 then
|
||||||
player_set_animation(player, "walk", animation_speed_mod)
|
player_set_animation(player, "walk", animation_speed_mod)
|
||||||
|
local name = player:get_player_name()
|
||||||
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)
|
||||||
elseif mcl_playerplus.elytra[player] and mcl_playerplus.elytra[player].active then
|
elseif mcl_playerplus.elytra[player] and mcl_playerplus.elytra[player].active then
|
||||||
|
|
Loading…
Reference in a new issue