Skip to content

Commit

Permalink
Add update_quest method to QuestManager script
Browse files Browse the repository at this point in the history
  • Loading branch information
shomykohai committed Jun 28, 2024
1 parent 70c3002 commit d815391
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions addons/quest_system/quest_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ func complete_quest(quest: Quest, args: Dictionary = {}) -> Quest:
return quest


func update_quest(quest: Quest, args: Dictionary = {}) -> Quest:
var pool_with_quest: BaseQuestPool = null

for pool in get_children():
if pool.is_quest_inside(quest):
pool_with_quest = pool
break

if pool_with_quest == null:
push_warning("Tried calling update on a Quest that is not in any pool.")
return quest

quest.update(args)

return quest


func mark_quest_as_available(quest: Quest) -> void:
if available.is_quest_inside(quest) or completed.is_quest_inside(quest) or active.is_quest_inside(quest):
return
Expand Down

0 comments on commit d815391

Please sign in to comment.