Fixed players dying multiple times

feature-rocketlauncher
unfa 2022-01-01 18:14:12 +01:00
parent cf6ce06a27
commit a10c4fe74d
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@ func _process(delta):
@rpc(call_local, any_peer, reliable) func take_damage(attacker: int, hit_position: Vector3, hit_normal: Vector3, damage:int, source_position: Vector3, damage_type, push: float):
var attacker_node = main.get_node("Players").get_node(str(attacker))
if is_multiplayer_authority():
if is_multiplayer_authority() and not dead:
print("Taken damage: ", damage, " by: ", attacker, " from: ", source_position)
hud.damage(damage)
health -= damage # reduce health