feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
parent
91081f4ad8
commit
f4c226423d
568 changed files with 10655 additions and 11019 deletions
|
|
@ -54,8 +54,10 @@ void DynamicObject::AddToWorld()
|
|||
///- Register the dynamicObject for guid lookup and for caster
|
||||
if (!IsInWorld())
|
||||
{
|
||||
sObjectAccessor->AddObject(this);
|
||||
GetMap()->GetObjectsStore().Insert<DynamicObject>(GetGUID(), this);
|
||||
|
||||
WorldObject::AddToWorld();
|
||||
|
||||
BindToCaster();
|
||||
}
|
||||
}
|
||||
|
|
@ -76,14 +78,17 @@ void DynamicObject::RemoveFromWorld()
|
|||
return;
|
||||
|
||||
UnbindFromCaster();
|
||||
|
||||
if (Transport* transport = GetTransport())
|
||||
transport->RemovePassenger(this, true);
|
||||
|
||||
WorldObject::RemoveFromWorld();
|
||||
sObjectAccessor->RemoveObject(this);
|
||||
|
||||
GetMap()->GetObjectsStore().Remove<DynamicObject>(GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type)
|
||||
bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type)
|
||||
{
|
||||
SetMap(caster->GetMap());
|
||||
Relocate(pos);
|
||||
|
|
@ -93,11 +98,11 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe
|
|||
return false;
|
||||
}
|
||||
|
||||
WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask());
|
||||
WorldObject::_Create(guidlow, HighGuid::DynamicObject, caster->GetPhaseMask());
|
||||
|
||||
SetEntry(spellId);
|
||||
SetObjectScale(1);
|
||||
SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());
|
||||
SetGuidValue(DYNAMICOBJECT_CASTER, caster->GetGUID());
|
||||
|
||||
// The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden
|
||||
// by client for most of the "ground patch" visual effect spells and a few "skyfall" ones like Hurricane.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue