reparent stuff fixed

This commit is contained in:
Chris Bell 2024-12-28 21:43:16 -06:00
parent f4b7bf282d
commit 999a88c402

View File

@ -107,6 +107,7 @@ func remove_piloting_player():
# When a player enters the ship's detection area # When a player enters the ship's detection area
func _on_player_entered(body): func _on_player_entered(body):
if body is Player and body.get_parent() != self: if body is Player and body.get_parent() != self:
if !body.is_network_authority: return
body.call_deferred("reparent", self, true) body.call_deferred("reparent", self, true)
body.ship_entered(self) body.ship_entered(self)
print("Player entered the ship area.") print("Player entered the ship area.")
@ -114,6 +115,7 @@ func _on_player_entered(body):
# When a player exits the ship's detection area # When a player exits the ship's detection area
func _on_player_exited(body): func _on_player_exited(body):
if body is Player and body.get_parent() != get_node("/root/DevLevel/"): if body is Player and body.get_parent() != get_node("/root/DevLevel/"):
if !body.is_network_authority: return
body.call_deferred("reparent", get_node("/root/DevLevel/"), true) body.call_deferred("reparent", get_node("/root/DevLevel/"), true)
body.ship_exited() body.ship_exited()
print("Player exited the ship area.") print("Player exited the ship area.")