Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarQuestManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/game/StarQuestManager.cpp')
-rw-r--r--source/game/StarQuestManager.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/game/StarQuestManager.cpp b/source/game/StarQuestManager.cpp
index 4e88500..4dbc652 100644
--- a/source/game/StarQuestManager.cpp
+++ b/source/game/StarQuestManager.cpp
@@ -398,19 +398,21 @@ void QuestManager::update(float dt) {
}
}
- StringMap<QuestPtr> allQuests = quests();
- for (auto& entry : allQuests) {
+ List<String> expiredQuests;
+ for (auto& entry : m_quests) {
auto quest = entry.second;
QuestState state = quest->state();
bool finished = state == QuestState::Complete || state == QuestState::Failed;
if (state == QuestState::New || (finished && quest->ephemeral() && !quest->showDialog())) {
quest->uninit();
- allQuests.remove(entry.first);
- m_quests.remove(entry.first);
+ expiredQuests.append(entry.first);
}
}
- for (auto& q : allQuests) {
+ for (auto& questId : expiredQuests)
+ m_quests.remove(questId);
+
+ for (auto& q : m_quests) {
if (questValidOnServer(q.second))
q.second->update(dt);
}