Core/Quests: Some cleanup in quest relation accessing

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-09-13 13:18:27 +02:00
parent c7289967b0
commit 6d0a031a77
6 changed files with 77 additions and 59 deletions
@@ -1315,8 +1315,8 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
bool Creature::hasQuest(uint32 quest_id) const
{
QuestRelations const& qr = sObjectMgr.mCreatureQuestRelations;
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
QuestRelationBounds qr = sObjectMgr.GetCreatureQuestRelationBounds(GetEntry());
for (QuestRelations::const_iterator itr = qr.first; itr != qr.second; ++itr)
{
if (itr->second == quest_id)
return true;
@@ -1326,8 +1326,8 @@ bool Creature::hasQuest(uint32 quest_id) const
bool Creature::hasInvolvedQuest(uint32 quest_id) const
{
QuestRelations const& qr = sObjectMgr.mCreatureQuestInvolvedRelations;
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
QuestRelationBounds qir = sObjectMgr.GetCreatureQuestInvolvedRelationBounds(GetEntry());
for (QuestRelations::const_iterator itr = qir.first; itr != qir.second; ++itr)
{
if (itr->second == quest_id)
return true;