adj: respawning kills self
This commit is contained in:
@@ -410,6 +410,11 @@ func _process(delta: float) -> void:
|
||||
if is_instance_valid(spring_arm):
|
||||
# Follow torso position exactly to avoid lerp bobbing
|
||||
spring_arm.global_position = torso.global_position
|
||||
|
||||
if death_screen and death_screen.visible:
|
||||
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) or Input.is_mouse_button_pressed(MOUSE_BUTTON_RIGHT) or Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_ENTER) or Input.is_key_pressed(KEY_ESCAPE) == false and (Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("jump") or Input.is_action_just_pressed("fire")):
|
||||
_on_respawn_pressed()
|
||||
|
||||
return
|
||||
|
||||
# Shield recharge logic
|
||||
|
||||
+15
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user