Merge branch 'dev' of https://github.falmouth.ac.uk/Games-Academy-Student-Work-22-23/the-twilight-abyss into dev
This commit is contained in:
commit
2ef306a49c
@ -54,12 +54,13 @@ void UQuestSystem::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom
|
||||
|
||||
void UQuestSystem::CheckActiveQuestConditions()
|
||||
{
|
||||
TArray<UQuest*> JustCompletedQuests;
|
||||
for (UQuest* Quest : ActiveQuests)
|
||||
{
|
||||
if (Quest->CheckConditions(GetWorldState()))
|
||||
{
|
||||
CompletedQuests.Add(Quest);
|
||||
Quest->ApplyRewards(PlayerInventory);
|
||||
JustCompletedQuests.Add(Quest);
|
||||
for (TTuple<FString, bool> QuestFlag : Quest->QuestFlagsOnComplete)
|
||||
{
|
||||
QuestFlags.Add(QuestFlag.Key, QuestFlag.Value);
|
||||
@ -79,6 +80,11 @@ void UQuestSystem::CheckActiveQuestConditions()
|
||||
}
|
||||
UpdateQuestGoalsUI(Quest);
|
||||
}
|
||||
for (UQuest* Quest : JustCompletedQuests)
|
||||
{
|
||||
ActiveQuests.Remove(Quest);
|
||||
Quest->ApplyRewards(PlayerInventory);
|
||||
}
|
||||
}
|
||||
|
||||
UWorldState* UQuestSystem::GetWorldState() const
|
||||
|
Loading…
Reference in New Issue
Block a user