aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-03-16 02:49:57 -0300
committerariel- <ariel-@users.noreply.github.com>2017-03-16 02:55:48 -0300
commit3b27a06265e4f022ec81b00ab99255246e8dd467 (patch)
tree9725ca78afd3efcad3433ee812eba10ea94a474d /src/server/game/Globals/ObjectMgr.cpp
parentdca276716fecb819fec668f59954113a77f9e393 (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
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index f7646a46ccc..b7a1788871f 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3961,7 +3961,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();
@@ -4046,8 +4046,7 @@ void ObjectMgr::LoadQuests()
for (QuestLoaderHelper const& loader : QuestLoaderHelpers)
{
- QueryResult result = WorldDatabase.Query(Trinity::StringFormat("SELECT %s FROM %s", loader.QueryFields, loader.TableName).c_str());
-
+ QueryResult result = WorldDatabase.PQuery("SELECT %s FROM %s", loader.QueryFields, loader.TableName);
if (!result)
TC_LOG_ERROR("server.loading", ">> Loaded 0 quest %s. DB table `%s` is empty.", loader.TableDesc, loader.TableName);
else
@@ -4582,8 +4581,6 @@ void ObjectMgr::LoadQuests()
{
if (_questTemplates.find(std::abs(qinfo->_prevQuestId)) == _questTemplates.end())
TC_LOG_ERROR("sql.sql", "Quest %u has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->_prevQuestId);
- else
- qinfo->PrevQuests.push_back(qinfo->_prevQuestId);
}
if (qinfo->_nextQuestId)
@@ -4592,7 +4589,7 @@ void ObjectMgr::LoadQuests()
if (qNextItr == _questTemplates.end())
TC_LOG_ERROR("sql.sql", "Quest %u 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)