Test recipe done
This commit is contained in:
parent
ea9c41054b
commit
014b161636
2 changed files with 3 additions and 1 deletions
|
@ -11,5 +11,5 @@ region = Rect2(8, 16, 4, 4)
|
||||||
script = ExtResource("2_rkyi0")
|
script = ExtResource("2_rkyi0")
|
||||||
display_name = &"Output"
|
display_name = &"Output"
|
||||||
preview = SubResource("AtlasTexture_r3jjm")
|
preview = SubResource("AtlasTexture_r3jjm")
|
||||||
stack_size = 100
|
stack_size = 5
|
||||||
metadata/_custom_type_script = "uid://p5327ibxtyfs"
|
metadata/_custom_type_script = "uid://p5327ibxtyfs"
|
||||||
|
|
|
@ -33,6 +33,8 @@ func get_output_structure() -> Structure:
|
||||||
return structure_parent.get_relative(rotated+Vector2(0.5,0.5))
|
return structure_parent.get_relative(rotated+Vector2(0.5,0.5))
|
||||||
|
|
||||||
func check_for_recipe(_stack : Stack, _position : int) -> void:
|
func check_for_recipe(_stack : Stack, _position : int) -> void:
|
||||||
|
if inventory.output_slot.held_item != null and inventory.output_slot.amount == inventory.output_slot.held_item.stack_size:
|
||||||
|
return
|
||||||
for i in range(len(selected_recipe.ingridients)):
|
for i in range(len(selected_recipe.ingridients)):
|
||||||
if inventory.input_array[i].amount < selected_recipe.ingridients[i].amount:
|
if inventory.input_array[i].amount < selected_recipe.ingridients[i].amount:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue