*Add some checks during object deconstruction.
--HG-- branch : trunk
This commit is contained in:
@@ -94,6 +94,8 @@ Object::~Object( )
|
||||
assert(false);
|
||||
}
|
||||
|
||||
assert(!m_objectUpdated);
|
||||
|
||||
//DEBUG_LOG("Object desctr 1 check (%p)",(void*)this);
|
||||
delete [] m_uint32Values;
|
||||
delete [] m_uint32Values_mirror;
|
||||
|
||||
@@ -69,7 +69,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
{
|
||||
//If a pet is dismissed, m_Controlled will change
|
||||
std::vector<Unit*> controlled;
|
||||
for(ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
for(Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
if((*itr)->GetEntry() == pet->GetEntry() && (*itr)->isAlive())
|
||||
controlled.push_back(*itr);
|
||||
for(std::vector<Unit*>::iterator itr = controlled.begin(); itr != controlled.end(); ++itr)
|
||||
|
||||
@@ -187,6 +187,11 @@ Unit::~Unit()
|
||||
RemoveAllDynObjects();
|
||||
|
||||
if(m_charmInfo) delete m_charmInfo;
|
||||
|
||||
assert(!m_attacking);
|
||||
assert(m_attackers.empty());
|
||||
assert(m_sharedVision.empty());
|
||||
assert(m_Controlled.empty());
|
||||
}
|
||||
|
||||
void Unit::Update( uint32 p_time )
|
||||
|
||||
+1
-2
@@ -847,12 +847,11 @@ struct AuraSlotEntry
|
||||
|
||||
struct SpellProcEventEntry; // used only privately
|
||||
|
||||
typedef std::set<Unit*> ControlList;
|
||||
|
||||
class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
{
|
||||
public:
|
||||
typedef std::set<Unit*> AttackerSet;
|
||||
typedef std::set<Unit*> ControlList;
|
||||
typedef std::pair<uint32, uint8> spellEffectPair;
|
||||
typedef std::multimap< spellEffectPair, Aura*> AuraMap;
|
||||
typedef std::list<Aura *> AuraList;
|
||||
|
||||
Reference in New Issue
Block a user