belt improvements

This commit is contained in:
Rendo 2025-10-15 09:35:37 +05:00
commit 4bae29f29f
7 changed files with 10 additions and 7 deletions

View file

@ -4,6 +4,6 @@ const test_item :=preload("res://generic/items/dbg_item.tres")
func _process(_delta: float) -> void:
for point in [Vector2(-1,0),Vector2(1,0),Vector2(0,1),Vector2(0,-1)]:
var found_structure = get_parent().get_relative(point)
var found_structure :Structure = get_parent().get_relative(point)
if found_structure and found_structure.inventory:
found_structure.inventory.add(Stack.new(test_item,1))
found_structure.inventory.add_from_side(Stack.new(test_item,randi_range(1,test_item.stack_size)),Structure.facing_to_vector(found_structure.facing).angle_to(point))