diff options
-rw-r--r-- | src/game/ObjectMgr.cpp | 16 | ||||
-rw-r--r-- | src/shared/revision_nr.h | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 3c18f0939d0..081acb07621 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -3381,14 +3381,15 @@ void ObjectMgr::LoadQuests() if(qinfo->NextQuestInChain) { - if(mQuestTemplates.find(qinfo->NextQuestInChain) == mQuestTemplates.end()) + QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestInChain); + if(qNextItr == mQuestTemplates.end()) { sLog.outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.", qinfo->GetQuestId(),qinfo->NextQuestInChain ,qinfo->NextQuestInChain ); qinfo->NextQuestInChain = 0; } else - mQuestTemplates[qinfo->NextQuestInChain]->prevChainQuests.push_back(qinfo->GetQuestId()); + qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId()); } // fill additional data stores @@ -3406,14 +3407,15 @@ void ObjectMgr::LoadQuests() if(qinfo->NextQuestId) { - if (mQuestTemplates.find(abs(qinfo->GetNextQuestId())) == mQuestTemplates.end()) + QuestMap::iterator qNextItr = mQuestTemplates.find(abs(qinfo->GetNextQuestId())); + if (qNextItr == mQuestTemplates.end()) { sLog.outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); } else { int32 signedQuestId = qinfo->NextQuestId < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId()); - mQuestTemplates[abs(qinfo->GetNextQuestId())]->prevQuests.push_back(signedQuestId); + qNextItr->second->prevQuests.push_back(signedQuestId); } } @@ -5171,7 +5173,8 @@ void ObjectMgr::LoadAccessRequirements() if(ar.heroicQuest) { - if(!mQuestTemplates[ar.heroicQuest]) + QuestMap::iterator qReqItr = mQuestTemplates.find(ar.heroicQuest); + if(qReqItr != mQuestTemplates.end()) { sLog.outErrorDb("Required Heroic Quest %u not exist for trigger %u, remove heroic quest done requirement.",ar.heroicQuest,requiremt_ID); ar.heroicQuest = 0; @@ -5180,7 +5183,8 @@ void ObjectMgr::LoadAccessRequirements() if(ar.quest) { - if(!mQuestTemplates[ar.quest]) + QuestMap::iterator qReqItr = mQuestTemplates.find(ar.quest); + if(qReqItr != mQuestTemplates.end()) { sLog.outErrorDb("Required Quest %u not exist for trigger %u, remove quest done requirement.",ar.quest,requiremt_ID); ar.quest = 0; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 25a6661fbd5..278a8f916ab 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7416" + #define REVISION_NR "7417" #endif // __REVISION_NR_H__ |