swap only with non null items
This commit is contained in:
parent
3ee2c8bdf1
commit
63485078bd
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user