mirror of
https://github.com/luanti-org/luanti.git
synced 2026-04-17 08:37:33 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user