mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10594] Use equal_range instead of lower_bound/upper_bound pairs
(based on zergtmn's repo commit 0499169) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
0caa0e32dd
commit
2fa5fa43bd
13 changed files with 207 additions and 182 deletions
|
|
@ -1290,10 +1290,10 @@ 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)
|
||||
QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestRelationsMapBounds(GetEntry());
|
||||
for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
if (itr->second == quest_id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1301,10 +1301,10 @@ 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)
|
||||
QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestInvolvedRelationsMapBounds(GetEntry());
|
||||
for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
{
|
||||
if(itr->second == quest_id)
|
||||
if (itr->second == quest_id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue