summaryrefslogtreecommitdiff
path: root/client/player
diff options
context:
space:
mode:
Diffstat (limited to 'client/player')
-rw-r--r--client/player/player.gd23
1 files changed, 8 insertions, 15 deletions
diff --git a/client/player/player.gd b/client/player/player.gd
index f418337b..6af1dd0c 100644
--- a/client/player/player.gd
+++ b/client/player/player.gd
@@ -90,33 +90,26 @@ func update_username_tag(state):
tag.visible = state
func set_item(i: Item):
- i.owned_by = hand_base
- if hand != null:
- hand.queue_free()
- if i == null:
- push_error("tile is null")
+ if hand != null: hand.remove()
+ character.holding = i != null
hand = i
- character.holding = true
+ if hand != null: hand.owned_by = hand_base
-func remove_item() -> Item:
+func remove_item():
var i = hand
- if i == null:
- push_error("holding nothing")
+ if i == null: push_error("holding nothing")
hand = null
character.holding = false
return i
func progress(position__: float, speed: float, warn: bool):
- if hand != null:
- hand.progress(position__, speed, warn)
+ if hand != null: hand.progress(position__, speed, warn)
func finish():
- if hand != null:
- hand.finish()
+ if hand != null: hand.finish()
func take_item(tile: Tile):
- if hand != null:
- push_error("already holding an item")
+ if hand != null: push_error("already holding an item")
var i = tile.take_item()
i.take()
set_item(i)