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