diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 2b08089a4..d3acf7d0c 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -79,14 +79,21 @@ Object::Object( ) : m_PackGUID(sizeof(uint64)+1) Object::~Object( ) { + if(IsInWorld()) + { + ///- Do NOT call RemoveFromWorld here, if the object is a player it will crash + sLog.outError("Object::~Object (GUID: %u TypeId: %u) deleted but still in world!!", GetGUIDLow(), GetTypeId()); + ASSERT(false); + } + + if(m_objectUpdated) + { + sLog.outError("Object::~Object (GUID: %u TypeId: %u) deleted but still have updated status!!", GetGUIDLow(), GetTypeId()); + ASSERT(false); + } + if(m_uint32Values) { - if(IsInWorld()) - { - ///- Do NOT call RemoveFromWorld here, if the object is a player it will crash - sLog.outError("Object::~Object (GUID: %u TypeId: %u) deleted but still in world!!", GetGUIDLow(), GetTypeId()); - //assert(0); - } //DEBUG_LOG("Object desctr 1 check (%p)",(void*)this); delete [] m_uint32Values; @@ -735,10 +742,13 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask * void Object::ClearUpdateMask(bool remove) { - for( uint16 index = 0; index < m_valuesCount; ++index ) + if(m_uint32Values) { - if(m_uint32Values_mirror[index]!= m_uint32Values[index]) - m_uint32Values_mirror[index] = m_uint32Values[index]; + for( uint16 index = 0; index < m_valuesCount; ++index ) + { + if(m_uint32Values_mirror[index]!= m_uint32Values[index]) + m_uint32Values_mirror[index] = m_uint32Values[index]; + } } if(m_objectUpdated) diff --git a/src/game/Object.h b/src/game/Object.h index 67a183ad9..4707f4717 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -129,8 +129,7 @@ class MANGOS_DLL_SPEC Object virtual void RemoveFromWorld() { // if we remove from world then sending changes not required - if(m_uint32Values) - ClearUpdateMask(true); + ClearUpdateMask(true); m_inWorld = false; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8fd47f530..32d09e3e0 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8718" + #define REVISION_NR "8719" #endif // __REVISION_NR_H__