False.Genesis d208bb3ec1 * 90% working UPDATE_OBJECT stuff, just bags are missing (need to make the class for bags).
* need to remove lots of debug output later, after bags are done.
* fixed ObjMgr. better store objects in only 1 list instead of storing them in 1 list per type.
* eased config: if you modify the conf files during runtime, just type "config" in the console and the changes will be applied.
2007-02-25 19:25:15 +00:00

63 lines
1.2 KiB
C++

#include "common.h"
#include "WorldSession.h"
#include "Object.h"
Object::Object()
{
_uint32values=NULL;
_type=TYPE_OBJECT;
_typeid=TYPEID_OBJECT;
_valuescount=0;
}
Object::~Object()
{
DEBUG(logdebug("~Object() id=%u ptr=0x%X valuesptr=0x%X",this->GetTypeId(),this,_uint32values));
if(_uint32values)
delete [] _uint32values;
}
void Object::_InitValues()
{
_uint32values = new uint32[ _valuescount ];
memset(_uint32values, 0, _valuescount*sizeof(uint32));
}
void Object::Create( uint64 guid )
{
//ASSERT(_valuescount > 0);
if(!_uint32values)
_InitValues();
SetUInt32Value( OBJECT_FIELD_GUID, GUID_LOPART(guid) );
SetUInt32Value( OBJECT_FIELD_GUID+1, GUID_HIPART(guid) );
SetUInt32Value( OBJECT_FIELD_TYPE, _type );
}
WorldObject::WorldObject()
{
_x = _y = _z = _o = 0;
_m = 0;
}
void WorldObject::SetPosition(float x, float y, float z, float o, uint16 _map)
{
_x = x;
_y = y;
_z = z;
_o = o;
_m = _map;
}
void WorldSession::_HandleDestroyObjectOpcode(WorldPacket& recvPacket)
{
uint64 guid;
recvPacket >> guid;
logdebug("Destroy Object "I64FMT,guid);
objmgr.Remove(guid);
}