From d8ae7a360da6204f6bb84d719dd4eeee5df3b6db Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Tue, 5 Nov 2024 01:20:34 -0500 Subject: [PATCH] handle corner case where player dies while in chair --- homedecor_seating/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homedecor_seating/init.lua b/homedecor_seating/init.lua index 4725e4ee..4f77efd5 100644 --- a/homedecor_seating/init.lua +++ b/homedecor_seating/init.lua @@ -210,6 +210,13 @@ function lrfurn.stand(clicker) end end +--if the player gets killed in the seat, handle it +minetest.register_on_dieplayer(function(player) + if seated_cache[player:get_player_name()] then + lrfurn.stand(player) + end +end) + dofile(modpath.."/longsofas.lua") dofile(modpath.."/sofas.lua") dofile(modpath.."/armchairs.lua")