Core/Quests: Fix pooling system causing wrong questrelations

Closes #3101 (probably few others)
This commit is contained in:
Elron103
2011-10-23 12:11:38 +01:00
committed by Nay
parent 5a12fb9964
commit 84a6417a4e
+2 -2
View File
@@ -260,7 +260,7 @@ void PoolGroup<Quest>::Despawn1Object(uint32 quest_id)
QuestRelations::iterator lastElement = questMap->upper_bound(itr->second); QuestRelations::iterator lastElement = questMap->upper_bound(itr->second);
for (; qitr != lastElement; ++qitr) for (; qitr != lastElement; ++qitr)
{ {
if (qitr->first == itr->second) if (qitr->first == itr->second && qitr->second == itr->first)
{ {
questMap->erase(qitr); // iterator is now no more valid questMap->erase(qitr); // iterator is now no more valid
break; // but we can exit loop since the element is found break; // but we can exit loop since the element is found
@@ -279,7 +279,7 @@ void PoolGroup<Quest>::Despawn1Object(uint32 quest_id)
QuestRelations::iterator lastElement = questMap->upper_bound(itr->second); QuestRelations::iterator lastElement = questMap->upper_bound(itr->second);
for (; qitr != lastElement; ++qitr) for (; qitr != lastElement; ++qitr)
{ {
if (qitr->first == itr->second) if (qitr->first == itr->second && qitr->second == itr->first)
{ {
questMap->erase(qitr); // iterator is now no more valid questMap->erase(qitr); // iterator is now no more valid
break; // but we can exit loop since the element is found break; // but we can exit loop since the element is found