This commit is contained in:
Rendo 2025-10-17 18:22:49 +05:00
commit 074bb21ffd
18 changed files with 99 additions and 51 deletions

View file

@ -29,7 +29,7 @@ func deferred_init():
down_array[i] = InventorySlot.new()
func add(stack : Stack, context: InventoryContext = null) -> Stack:
if context == null:
if context == null or stack == null:
return stack
if context.position == context.target.global_position:
return add_to_array(stack,upper_array,context)
@ -72,3 +72,8 @@ func take(item : Item,amount: int) -> Stack:
## Finds first entry of item. Returns -1 if no item found
func find(item : Item) -> int:
return -1
func refresh() -> void:
for i in range(capacity):
upper_array[i].updated = false
down_array[i].updated = false