summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2024-06-24 14:27:55 +0200
committernokoe <nokoe@mailbox.org>2024-06-24 14:27:55 +0200
commite123565277c0dc2508b47c2587c22c9fe6e3d738 (patch)
tree177ac16d2d7d408fe79ffaf3aa2066473ac83d0a
parentc011ed88fbacee5c736a712128bc248ff4061546 (diff)
downloadhurrycurry-e123565277c0dc2508b47c2587c22c9fe6e3d738.tar
hurrycurry-e123565277c0dc2508b47c2587c22c9fe6e3d738.tar.bz2
hurrycurry-e123565277c0dc2508b47c2587c22c9fe6e3d738.tar.zst
set_item: free items in hand
-rw-r--r--client/game.gd2
-rw-r--r--client/player/player.gd2
2 files changed, 3 insertions, 1 deletions
diff --git a/client/game.gd b/client/game.gd
index 74c79d8b..f1f4e065 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -51,7 +51,7 @@ func _ready():
var player: Player = players.get(id)
if player != null:
if player.hand != null:
- player.hand.free()
+ player.hand.queue_free()
players.erase(id)
player.queue_free()
)
diff --git a/client/player/player.gd b/client/player/player.gd
index a6122a97..d64b5d43 100644
--- a/client/player/player.gd
+++ b/client/player/player.gd
@@ -51,6 +51,8 @@ func update_position(new_position: Vector2, new_rotation: float):
func set_item(i: Item):
i.owned_by = hand_base
+ if hand != null:
+ hand.queue_free()
if i == null:
push_error("tile is null")
hand = i