MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / init

Method init

source/game/StarQuestManager.cpp:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void QuestManager::init(World* world) {
75 m_world = world;
76 for (auto& quest : m_quests.values()) {
77 if (!questValidOnServer(quest))
78 continue;
79 quest->init(m_player, world, m_client);
80 }
81 m_trackOnWorldQuests = true;
82
83 // untrack tracked quest if it's not cross-server, and we're on a different server
84 if (auto tracked = m_trackedQuestId) {
85 if (auto maybeQuest = m_quests.maybe(*tracked)) {
86 auto quest = *maybeQuest;
87 if (quest->hideCrossServer() && quest->serverUuid() && *quest->serverUuid() != m_player->clientContext()->serverUuid())
88 m_trackedQuestId = {};
89 }
90 }
91}
92
93void QuestManager::uninit() {
94 m_quests.values().exec([](QuestPtr const& quest) { quest->uninit(); });

Callers 1

offerMethod · 0.45

Calls 5

hideCrossServerMethod · 0.80
valuesMethod · 0.45
maybeMethod · 0.45
serverUuidMethod · 0.45
clientContextMethod · 0.45

Tested by

no test coverage detected