Return of smooth belt

This commit is contained in:
Rendo 2025-10-16 19:52:27 +05:00
commit d413c211b5
3 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
extends StructureBehaviour
@onready var animator : AnimationPlayer = $"../AnimationPlayer"
@onready var inventory : BeltInventory = structure_parent.inventory
func _draw() -> void:
for i in range(inventory.capacity):
@ -23,7 +23,7 @@ func get_next() -> Structure:
return structure_parent.get_relative(structure_parent.direction_vector())
func try_transfer(structure : Structure) -> void:
if structure == null or inventory.internal_array[inventory.capacity-1].amount == 0:
if structure == null or inventory.internal_array[inventory.capacity-1].amount == 0 or inventory.progress_array[inventory.capacity-1] < inventory.pop_treshold:
return
var last_slot = inventory.internal_array[inventory.capacity-1]
var ang_diff = structure_parent.direction_difference(structure)