adj: respawning kills self

This commit is contained in:
DottsGit
2026-06-06 14:23:28 -04:00
parent 2a3e6a2c78
commit d3680765da
2 changed files with 20 additions and 1 deletions
+15 -1
View File
@@ -92,7 +92,21 @@ func _resume() -> void:
func _respawn() -> void:
_resume() # Unpause
get_tree().reload_current_scene()
# Find local player
var local_player: Node3D = null
if get_tree().current_scene.has_node("Players"):
for p in get_tree().current_scene.get_node("Players").get_children():
if p.has_method("is_multiplayer_authority") and p.is_multiplayer_authority():
local_player = p
break
if not local_player:
local_player = get_tree().current_scene.get_node_or_null("Player")
if local_player and local_player.has_method("take_damage"):
local_player.take_damage(9999, Vector3.ZERO)
func _build_ui() -> void:
bg = ColorRect.new()