*Search for aura caster in our out of world in Aura::UnregisterSingleTarget().
--HG-- branch : trunk
This commit is contained in:
@@ -98,6 +98,21 @@ class ObjectAccessor
|
||||
|
||||
// TODO: override these template functions for each holder type and add assertions
|
||||
|
||||
template<class T> static T* GetObjectInOrOutOfWorld(uint64 guid, T* /*typeSpecifier*/)
|
||||
{
|
||||
return HashMapHolder<T>::Find(guid);
|
||||
}
|
||||
static Unit* GetObjectInOrOutOfWorld(uint64 guid, Unit* /*typeSpecifier*/)
|
||||
{
|
||||
if (IS_PLAYER_GUID(guid))
|
||||
return (Unit*)GetObjectInOrOutOfWorld(guid, (Player*)NULL);
|
||||
|
||||
if (IS_PET_GUID(guid))
|
||||
return (Unit*)GetObjectInOrOutOfWorld(guid, (Pet*)NULL);
|
||||
|
||||
return (Unit*)GetObjectInOrOutOfWorld(guid, (Creature*)NULL);
|
||||
}
|
||||
|
||||
// returns object if is in world
|
||||
template<class T> static T* GetObjectInWorld(uint64 guid, T* /*typeSpecifier*/)
|
||||
{
|
||||
|
||||
@@ -764,7 +764,8 @@ bool Aura::IsVisible() const
|
||||
void Aura::UnregisterSingleTarget()
|
||||
{
|
||||
ASSERT(m_isSingleTarget);
|
||||
Unit * caster = GetCaster();
|
||||
Unit * caster = ObjectAccessor::GetObjectInOrOutOfWorld(GetCasterGUID(), (Unit*)NULL);//GetCaster();
|
||||
assert(caster);
|
||||
caster->GetSingleCastAuras().remove(this);
|
||||
SetIsSingleTarget(false);
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ bool SpellCastTargets::read (WorldPacket * data, Unit *caster)
|
||||
if (!(m_targetMask & TARGET_FLAG_SOURCE_LOCATION))
|
||||
m_srcPos.Relocate(caster);
|
||||
|
||||
if (!(m_targetMask & TARGET_FLAG_DEST_LOCATION)
|
||||
if (!(m_targetMask & TARGET_FLAG_DEST_LOCATION))
|
||||
m_dstPos.Relocate(caster);
|
||||
|
||||
// find real units/GOs
|
||||
|
||||
Reference in New Issue
Block a user