diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-03-16 02:49:57 -0300 |
|---|---|---|
| committer | funjoker <funjoker109@gmail.com> | 2020-04-24 17:18:48 +0200 |
| commit | 1536f01a7448bc3401686e55894a943835060fcd (patch) | |
| tree | 16d071b0752ca38c89d6ee32c4d8682d4a2dbaba /src/server/game/Globals/ObjectMgr.cpp | |
| parent | c03373c59fd4103096936a19d8dd668959620a29 (diff) | |
Core/Quests: fixed exclusivegroup interaction with prevquestId and nextQuestId.
- They should work as documented by wiki now.
- Add some consts to Player methods
- Fixed negative PrevQuestID to mean only active quest (ie not rewarded/complete, as those quests are required to complete another)
Closes #19300
(cherry picked from commit 3b27a06265e4f022ec81b00ab99255246e8dd467)
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2c05f4662c3..84196190cce 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3874,7 +3874,7 @@ void ObjectMgr::LoadQuests() uint32 oldMSTime = getMSTime(); // For reload case - for (QuestMap::const_iterator itr=_questTemplates.begin(); itr != _questTemplates.end(); ++itr) + for (auto itr = _questTemplates.begin(); itr != _questTemplates.end(); ++itr) delete itr->second; _questTemplates.clear(); _questObjectives.clear(); @@ -3969,7 +3969,7 @@ void ObjectMgr::LoadQuests() for (QuestLoaderHelper const& loader : QuestLoaderHelpers) { - QueryResult result = WorldDatabase.Query(Trinity::StringFormat("SELECT %s FROM %s %s", loader.QueryFields, loader.TableName, loader.QueryExtra).c_str()); + QueryResult result = WorldDatabase.PQuery("SELECT %s FROM %s", loader.QueryFields, loader.TableName, loader.QueryExtra); if (!result) TC_LOG_ERROR("server.loading", ">> Loaded 0 quest %s. DB table `%s` is empty.", loader.TableDesc, loader.TableName); @@ -4617,8 +4617,6 @@ void ObjectMgr::LoadQuests() { if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end()) TC_LOG_ERROR("sql.sql", "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); - else - qinfo->PrevQuests.push_back(qinfo->_prevQuestID); } if (qinfo->_nextQuestID) @@ -4627,7 +4625,7 @@ void ObjectMgr::LoadQuests() if (qNextItr == _questTemplates.end()) TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %u, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); else - qNextItr->second->PrevQuests.push_back(static_cast<int32>(qinfo->GetQuestId())); + qNextItr->second->DependentPreviousQuests.push_back(qinfo->GetQuestId()); } if (qinfo->_exclusiveGroup) |
