From 63485078bdb0077e56ae0298bc35f7566f7d3014 Mon Sep 17 00:00:00 2001 From: Altaezio Date: Mon, 13 Oct 2025 18:53:44 +0200 Subject: [PATCH] swap only with non null items --- entities/player/scripts/player.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entities/player/scripts/player.gd b/entities/player/scripts/player.gd index 2659f40..a91adda 100644 --- a/entities/player/scripts/player.gd +++ b/entities/player/scripts/player.gd @@ -128,7 +128,7 @@ func try_move(move_to : Vector2): func pick_item(item : Item) -> Item: play_sfx("pick") var available_slot_ind = inventory.get_best_available_slot_ind() - if available_slot_ind == inventory.current_item_ind: + if available_slot_ind == inventory.current_item_ind && inventory.items[available_slot_ind] != null: var current_item : Item = inventory.get_item() inventory.set_item(item, available_slot_ind) return current_item