From 15be00667282a253fb438fec9d6347f5af89d9a0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 24 Dec 2024 21:59:26 +0100 Subject: fix two-handed clear progres --- client/game.gd | 4 ++-- client/menu/settings/input/input_value_node.gd | 1 - client/player/player.gd | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/game.gd b/client/game.gd index 850d539e..9a6b8808 100644 --- a/client/game.gd +++ b/client/game.gd @@ -166,7 +166,7 @@ func handle_packet(p): var t: Tile = map.get_tile_instance(p.item.tile) t.finish() else: - players[p.item.player].finish() + players[p.item.player[0]].finish(p.item.player[1]) "set_item": var location: Dictionary = p["location"] if p.item != null: @@ -193,7 +193,7 @@ func handle_packet(p): else: var pl: Player = players[p.location.player[0]] var h = p.location.player[1] - pl.finish() + pl.finish(h) pl.set_item(null, h) "update_map": var neighbors: Array = p["neighbors"] diff --git a/client/menu/settings/input/input_value_node.gd b/client/menu/settings/input/input_value_node.gd index 44a65ec5..9cf8327a 100644 --- a/client/menu/settings/input/input_value_node.gd +++ b/client/menu/settings/input/input_value_node.gd @@ -72,5 +72,4 @@ func events_equal(e1: InputEvent, e2: InputEvent) -> bool: func _on_add_pressed() -> void: listening = not listening - add_button.text = tr("c.settings.input.press_any_key") if listening else add_text diff --git a/client/player/player.gd b/client/player/player.gd index 3285cafc..223d2c88 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -121,11 +121,11 @@ func remove_item(h): func progress(position__: float, speed: float, warn: bool, h): if hand[G.hand_to_index(h)] != null: hand[G.hand_to_index(h)].progress(position__, speed, warn) -func finish(): - if hand != null: hand.finish() +func finish(h): + if hand[G.hand_to_index(h)] != null: hand[G.hand_to_index(h)].finish() func take_item(tile: Tile, h): - if hand != null: push_error("already holding an item") + if hand[G.hand_to_index(h)] != null: push_error("already holding an item") var i = tile.take_item() i.take() set_item(i, h) -- cgit v1.2.3-70-g09d2