From c03373c59fd4103096936a19d8dd668959620a29 Mon Sep 17 00:00:00 2001 From: ariel- Date: Thu, 16 Mar 2017 01:27:13 -0300 Subject: Core/Quests: changed quest_template_addon.NextQuestID to unsigned - No reason to keep this anymore after 4349adf0f25210e5b26201523a09bc26b4a83394, this is a broken functionality. (cherry picked from commit dca276716fecb819fec668f59954113a77f9e393) --- src/server/game/Globals/ObjectMgr.cpp | 9 +++------ src/server/game/Quests/QuestDef.cpp | 2 +- src/server/game/Quests/QuestDef.h | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3971062fe57..2c05f4662c3 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4623,14 +4623,11 @@ void ObjectMgr::LoadQuests() if (qinfo->_nextQuestID) { - QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId())); + auto qNextItr = _questTemplates.find(qinfo->GetNextQuestId()); if (qNextItr == _questTemplates.end()) - TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); + TC_LOG_ERROR("sql.sql", "Quest %d has NextQuestId %u, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); else - { - int32 signedQuestId = qinfo->_nextQuestID < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId()); - qNextItr->second->PrevQuests.push_back(signedQuestId); - } + qNextItr->second->PrevQuests.push_back(static_cast(qinfo->GetQuestId())); } if (qinfo->_exclusiveGroup) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 115c72c83d2..28685dc58ec 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -191,7 +191,7 @@ void Quest::LoadQuestTemplateAddon(Field* fields) _allowableClasses = fields[2].GetUInt32(); _sourceSpellID = fields[3].GetUInt32(); _prevQuestID = fields[4].GetInt32(); - _nextQuestID = fields[5].GetInt32(); + _nextQuestID = fields[5].GetUInt32(); _exclusiveGroup = fields[6].GetInt32(); _rewardMailTemplateId = fields[7].GetUInt32(); _rewardMailDelay = fields[8].GetUInt32(); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 04ee9468b72..8157f647627 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -387,7 +387,7 @@ class TC_GAME_API Quest uint32 GetSuggestedPlayers() const { return _suggestedPlayers; } uint32 GetLimitTime() const { return _limitTime; } int32 GetPrevQuestId() const { return _prevQuestID; } - int32 GetNextQuestId() const { return _nextQuestID; } + uint32 GetNextQuestId() const { return _nextQuestID; } int32 GetExclusiveGroup() const { return _exclusiveGroup; } uint32 GetNextQuestInChain() const { return _nextQuestInChain; } int32 GetRewArenaPoints() const {return _rewardArenaPoints; } @@ -580,7 +580,7 @@ class TC_GAME_API Quest uint32 _allowableClasses = 0; uint32 _sourceSpellID = 0; int32 _prevQuestID = 0; - int32 _nextQuestID = 0; + uint32 _nextQuestID = 0; int32 _exclusiveGroup = 0; uint32 _rewardMailTemplateId = 0; uint32 _rewardMailDelay = 0; -- cgit v1.2.3