Skip to content

Commit

Permalink
Merge pull request #256 from antono2/fix_fridge_update
Browse files Browse the repository at this point in the history
Fixed fridge inventory update
  • Loading branch information
Phazorknight authored Aug 28, 2024
2 parents 62f717e + 8364eea commit 60e549f
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 60e549f

Please sign in to comment.