AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectGridUnloader Class Reference

#include "ObjectGridLoader.h"

Public Member Functions

void Visit (CorpseMapType &)
 
template<class T >
void Visit (GridRefMgr< T > &m)
 

Detailed Description

Member Function Documentation

◆ Visit() [1/2]

void ObjectGridUnloader::Visit ( CorpseMapType )
inline
67{ } // corpses are deleted with Map

◆ Visit() [2/2]

template<class T >
void ObjectGridUnloader::Visit ( GridRefMgr< T > &  m)
  • object will get delinked from the manager when deleted
215{
216 while (!m.IsEmpty())
217 {
218 T* obj = m.getFirst()->GetSource();
219 // if option set then object already saved at this moment
220 //if (!sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY))
221 // obj->SaveRespawnTime();
222 //Some creatures may summon other temp summons in CleanupsBeforeDelete()
223 //So we need this even after cleaner (maybe we can remove cleaner)
224 //Example: Flame Leviathan Turret 33139 is summoned when a creature is deleted
225 //TODO: Check if that script has the correct logic. Do we really need to summons something before deleting?
226 obj->CleanupsBeforeDelete();
228 delete obj;
229 }
230}
bool IsEmpty() const
Definition: LinkedList.h:97
FROM * GetSource() const
Definition: Reference.h:97
GridReference< OBJECT > * getFirst()
Definition: GridRefMgr.h:32

References GridRefMgr< OBJECT >::getFirst(), and LinkedListHead::IsEmpty().