From d68634f23a21e55405cfa835f7e7bc61392f030e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 7 Jun 2025 17:22:31 +0200 Subject: fix warnings on player constructor --- client/player/player.gd | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'client') diff --git a/client/player/player.gd b/client/player/player.gd index dba63cbf..5650c52e 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -55,15 +55,18 @@ const DEFAULT_HAND_BASE_POSITION_CENTER: Vector3 = Vector3(0, .425, .4) const DEFAULT_HAND_BASE_POSITION_LEFT: Vector3 = Vector3(.3, .425, .4) const DEFAULT_HAND_BASE_POSITION_RIGHT: Vector3 = Vector3(-.3, .425, .4) -func _init(_id: int, name_: String, pos: Vector2, character_style: Dictionary, player_class: String, game: Game): +func _init(_id: int, name_: String, pos: Vector2, character_style_: Dictionary, player_class_: String, game_: Game): + character_style = character_style_ + player_class = player_class_ + game = game_ + if name_ != "": + name = name_ + username = name_ + add_child(movement_base) movement_base.add_child(character) position_ = pos position_anim = pos - if name_ != "": - name = name_ - self.game = game - username = name_ if game.hand_count == 1: var center = Node3D.new() @@ -91,8 +94,6 @@ func _init(_id: int, name_: String, pos: Vector2, character_style: Dictionary, p marker.visible = false add_child(marker) - self.character_style = character_style - self.player_class = player_class is_customer = player_class == "customer" is_chef = player_class == "chef" -- cgit v1.2.3-70-g09d2