From 12b3e34f8817d9916963be8c2778c68b25de35a3 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 8 Jan 2024 03:36:29 +0100 Subject: [PATCH] Fix a crash Defensive check for nonexistent player --- mods/PLAYER/mcl_player/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 0e666aa5b..9dbd1f724 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -230,7 +230,10 @@ minetest.register_globalstep(function(dtime) player_set_animation(player, "die") elseif player:get_meta():get_int("mcl_damage:damage_animation") > 0 then player_set_animation(player, "walk", animation_speed_mod) + local name = player:get_player_name() 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) end) elseif mcl_playerplus.elytra[player] and mcl_playerplus.elytra[player].active then