mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Merge commit 'origin/master' into 330
This commit is contained in:
commit
5e15a6553c
36 changed files with 351 additions and 213 deletions
|
|
@ -31,7 +31,6 @@
|
|||
#include "UpdateMask.h"
|
||||
#include "Util.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Log.h"
|
||||
#include "Transports.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
|
|
@ -80,9 +79,6 @@ Object::Object( ) : m_PackGUID(sizeof(uint64)+1)
|
|||
|
||||
Object::~Object( )
|
||||
{
|
||||
if(m_objectUpdated)
|
||||
ObjectAccessor::Instance().RemoveUpdateObject(this);
|
||||
|
||||
if(m_uint32Values)
|
||||
{
|
||||
if(IsInWorld())
|
||||
|
|
@ -744,10 +740,11 @@ void Object::ClearUpdateMask(bool remove)
|
|||
if(m_uint32Values_mirror[index]!= m_uint32Values[index])
|
||||
m_uint32Values_mirror[index] = m_uint32Values[index];
|
||||
}
|
||||
|
||||
if(m_objectUpdated)
|
||||
{
|
||||
if(remove)
|
||||
ObjectAccessor::Instance().RemoveUpdateObject(this);
|
||||
RemoveFromClientUpdateList();
|
||||
m_objectUpdated = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -801,7 +798,7 @@ void Object::SetInt32Value( uint16 index, int32 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -820,7 +817,7 @@ void Object::SetUInt32Value( uint16 index, uint32 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -839,7 +836,7 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -858,7 +855,7 @@ void Object::SetFloatValue( uint16 index, float value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -884,7 +881,7 @@ void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -910,7 +907,7 @@ void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -979,7 +976,7 @@ void Object::SetFlag( uint16 index, uint32 newFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1000,7 +997,7 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1025,7 +1022,7 @@ void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1050,7 +1047,7 @@ void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag )
|
|||
{
|
||||
if(!m_objectUpdated)
|
||||
{
|
||||
ObjectAccessor::Instance().AddUpdateObject(this);
|
||||
AddToClientUpdateList();
|
||||
m_objectUpdated = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1079,6 +1076,24 @@ void Object::BuildUpdateDataForPlayer(Player* pl, UpdateDataMapType& update_play
|
|||
BuildValuesUpdateBlockForPlayer(&iter->second, iter->first);
|
||||
}
|
||||
|
||||
void Object::AddToClientUpdateList()
|
||||
{
|
||||
sLog.outError("Unexpected call of Object::AddToClientUpdateList for object (TypeId: %u Update fields: %u)",GetTypeId(), m_valuesCount);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Object::RemoveFromClientUpdateList()
|
||||
{
|
||||
sLog.outError("Unexpected call of Object::RemoveFromClientUpdateList for object (TypeId: %u Update fields: %u)",GetTypeId(), m_valuesCount);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Object::BuildUpdateData( UpdateDataMapType& update_players )
|
||||
{
|
||||
sLog.outError("Unexpected call of Object::BuildUpdateData for object (TypeId: %u Update fields: %u)",GetTypeId(), m_valuesCount);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
WorldObject::WorldObject()
|
||||
: m_mapId(0), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL),
|
||||
m_positionX(0.0f), m_positionY(0.0f), m_positionZ(0.0f), m_orientation(0.0f), m_currMap(NULL)
|
||||
|
|
@ -1871,6 +1886,16 @@ void WorldObject::UpdateObjectVisibility()
|
|||
GetMap()->UpdateObjectVisibility(this, cell, p);
|
||||
}
|
||||
|
||||
void WorldObject::AddToClientUpdateList()
|
||||
{
|
||||
GetMap()->AddUpdateObject(this);
|
||||
}
|
||||
|
||||
void WorldObject::RemoveFromClientUpdateList()
|
||||
{
|
||||
GetMap()->RemoveUpdateObject(this);
|
||||
}
|
||||
|
||||
struct WorldObjectChangeAccumulator
|
||||
{
|
||||
UpdateDataMapType &i_updateDatas;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue