From 22952fd591d74a453c15d3a2a7426179ed9c04e5 Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Fri, 1 Dec 2023 16:18:40 +0000 Subject: [PATCH] Respawn dead players when they login so they don't get stuck without the death formspec --- mods/PLAYER/mcl_playerplus/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 99da0a01a..0ad34cae8 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -657,6 +657,7 @@ end) -- set to blank on join (for 3rd party mods) minetest.register_on_joinplayer(function(player) local name = player:get_player_name() + local hp = player:get_hp() mcl_playerplus_internal[name] = { lastPos = nil, @@ -671,6 +672,10 @@ minetest.register_on_joinplayer(function(player) player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3, 5.785, 0)) player:set_bone_position("Arm_Left_Pitch_Control", vector.new(3, 5.785, 0)) player:set_bone_position("Body_Control", vector.new(0, 6.75, 0)) + -- Respawn dead players on joining + if hp <= 0 then + player:respawn() + end end) -- clear when player leaves