[7690] Move GetCreature/GetGameobject to class Map. Author: VladimirMangos

* This let get objects at map without reference to player or another object.
    * Simplify future implementation for per-map storage for like objects

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-04-20 20:28:19 -05:00
1 parent b4046ddf88
commit fc7e1db9fb
28 files changed
+140 -163

No files matched your search

+6 -6
View File
@@ -152,7 +152,7 @@ void SpellCastTargets::setCorpseTarget(Corpse* corpse)
void SpellCastTargets::Update(Unit* caster)
{
m_GOTarget = m_GOTargetGUID ? ObjectAccessor::GetGameObject(*caster,m_GOTargetGUID) : NULL;
m_GOTarget = m_GOTargetGUID ? caster->GetMap()->GetGameObject(m_GOTargetGUID) : NULL;
m_unitTarget = m_unitTargetGUID ?
( m_unitTargetGUID==caster->GetGUID() ? caster : ObjectAccessor::GetUnit(*caster, m_unitTargetGUID) ) :
NULL;
@@ -848,7 +848,7 @@ void Spell::AddGOTarget(GameObject* pVictim, uint32 effIndex)
void Spell::AddGOTarget(uint64 goGUID, uint32 effIndex)
{
GameObject* go = ObjectAccessor::GetGameObject(*m_caster, goGUID);
GameObject* go = m_caster->GetMap()->GetGameObject(goGUID);
if (go)
AddGOTarget(go, effIndex);
}
@@ -1244,7 +1244,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target)
if(!effectMask)
return;
GameObject* go = ObjectAccessor::GetGameObject(*m_caster, target->targetGUID);
GameObject* go = m_caster->GetMap()->GetGameObject(target->targetGUID);
if(!go)
return;
@@ -2663,7 +2663,7 @@ void Spell::update(uint32 difftime)
{
GOTargetInfo* target = &*ihit;
GameObject* go = ObjectAccessor::GetGameObject(*m_caster, target->targetGUID);
GameObject* go = m_caster->GetMap()->GetGameObject(target->targetGUID);
if(!go)
continue;
@@ -3204,7 +3204,7 @@ void Spell::SendChannelStart(uint32 duration)
{
if(itr->effectMask & (1<<0) )
{
target = ObjectAccessor::GetGameObject(*m_caster, itr->targetGUID);
target = m_caster->GetMap()->GetGameObject(itr->targetGUID);
break;
}
}
@@ -5433,7 +5433,7 @@ bool Spell::CheckTarget( Unit* target, uint32 eff )
// Get GO cast coordinates if original caster -> GO
WorldObject *caster = NULL;
if (IS_GAMEOBJECT_GUID(m_originalCasterGUID))
caster = ObjectAccessor::GetGameObject(*m_caster, m_originalCasterGUID);
caster = m_caster->GetMap()->GetGameObject(m_originalCasterGUID);
if (!caster)
caster = m_caster;
if(target!=m_caster && !target->IsWithinLOSInMap(caster))