Skip to content

Commit

Permalink
Fixed fridge inventory update
Browse files Browse the repository at this point in the history
  • Loading branch information
antono2 committed Aug 28, 2024
1 parent ed6acff commit 8364eea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions COGITO/DemoScenes/DemoPrefabs/kitchen_fridge_container.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ script = ExtResource("7_fhl3i")
quest_to_update = ExtResource("8_wpbw8")
update_type = 2

[connection signal="container_closed" from="." to="InventoryCheckerWIN" method="check_inventory"]
[connection signal="container_closed" from="." to="InventoryCheckerFAIL" method="check_inventory"]
[connection signal="container_closed" from="." to="InventoryCheckerWIN" method="check_inventory" flags=3]
[connection signal="container_closed" from="." to="InventoryCheckerWIN" method="update_inventory"]
[connection signal="container_closed" from="." to="InventoryCheckerFAIL" method="check_inventory" flags=3]
[connection signal="container_closed" from="." to="InventoryCheckerFAIL" method="update_inventory"]
[connection signal="item_found" from="InventoryCheckerWIN" to="QuestUpdaterWIN" method="update_quest"]
[connection signal="item_found" from="InventoryCheckerFAIL" to="QuestUpdaterFAIL" method="update_quest"]
4 changes: 4 additions & 0 deletions COGITO/Scripts/inventory_checker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func is_item_in_inventory(sought_item:InventoryItemPD, inventory: CogitoInventor
return false


func update_inventory() -> void:
container_inventory = container_to_check.inventory_data


func check_inventory() -> void:
print("Inventory checker: Checking for ", item_to_check_for.name, " in ", container_inventory)
if is_item_in_inventory(item_to_check_for, container_inventory):
Expand Down

0 comments on commit 8364eea

Please sign in to comment.