Changeset 20 for trunk/src/hearthstone-world/ObjectMgr.cpp
- Timestamp:
- 09/20/09 20:13:24 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/hearthstone-world/ObjectMgr.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/hearthstone-world/ObjectMgr.cpp
r19 r20 189 189 delete (itr->second); 190 190 191 Log.Notice("ObjectMgr", "Deleting Achievement Quest Map..."); 192 for(map<uint32,set<Quest*>*>::iterator qitr = ZoneToQuestMap.begin(); qitr != ZoneToQuestMap.end(); ++qitr) 193 delete qitr->second; 191 AchievementEntry* ae; 192 for(uint32 i = 0; i < dbcAchivementCriteria.GetNumRows(); ++i) 193 { 194 ae = dbcAchievement.LookupRow(i); 195 if( ae ) 196 { 197 delete ae->AssociatedCriteria; 198 } 199 } 194 200 } 195 201 void ObjectMgr::LoadAchievements() … … 200 206 if(ae) 201 207 { 208 ae->AssociatedCriteria = new vector<uint32>; 202 209 ae->AssociatedCriteriaCount = 0; 203 210 } … … 227 234 if( ae ) 228 235 { 229 if(ae->AssociatedCriteriaCount >= 32) continue; 230 ae->AssociatedCriteria[ ae->AssociatedCriteriaCount ] = ace->ID; 236 //if(ae->AssociatedCriteriaCount >= 32) continue; 237 ae->AssociatedCriteria->push_back( ace->ID ); 238 //ae->AssociatedCriteria[ ae->AssociatedCriteriaCount ] = ace->ID; 231 239 ae->AssociatedCriteriaCount++; 232 240 } 233 }234 }235 236 // For Achievements: Complete Quest by Zone Id237 StorageContainerIterator<Quest> * itr = QuestStorage.MakeIterator();238 for(; !itr->AtEnd(); itr->Inc() )239 {240 Quest * pQuest = itr->Get();241 if(!pQuest) continue;242 243 uint32 QuestZone = pQuest->zone_id;244 map<uint32,set<Quest*>*>::iterator qitr = ZoneToQuestMap.find( QuestZone );245 if( qitr == ZoneToQuestMap.end() )246 {247 // We don't have any entries for this zone yet.248 set<Quest*>* mySet = new set<Quest*>;249 mySet->insert( pQuest );250 ZoneToQuestMap.insert( make_pair( QuestZone, mySet ) );251 }252 else253 {254 set<Quest*>* thisSet = qitr->second;255 thisSet->insert( pQuest );256 241 } 257 242 }