Re-show death screen when a formspec is closed while player is dead (#17036)

This commit ensures that the death formspec is re-shown in case another formspec force-closed it.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
sofar
2026-04-01 12:16:44 -07:00
committed by GitHub
parent 82149c3e82
commit c432281ac0
+8
View File
@@ -27,5 +27,13 @@ core.register_on_player_receive_fields(function(player, formname, fields)
player:respawn()
core.log("action", player:get_player_name() .. " respawns at " ..
player:get_pos():to_string())
return
end
-- If a non-death formspec was closed while the player is dead,
-- re-show the death screen to prevent the "zombie state" (see #11523).
if formname ~= "__builtin:death" and fields.quit and player:get_hp() == 0 then
core.log("info", "Re-showing death screen to " .. player:get_player_name())
core.show_death_screen(player, nil)
end
end)