mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7690] Move GetCreature/GetGameobject to class Map.
* This let get objects at map without reference to player or another object. * Simplify future implementation for per-map storage for like objects
This commit is contained in:
parent
ee9ea143d1
commit
fc0e1ecdf1
20 changed files with 118 additions and 127 deletions
|
|
@ -158,7 +158,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;
|
||||
|
|
@ -956,7 +956,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);
|
||||
}
|
||||
|
|
@ -1233,7 +1233,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;
|
||||
|
||||
|
|
@ -1784,7 +1784,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
|
|||
// Check original caster is GO - set its coordinates as dst cast
|
||||
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;
|
||||
// Set dest for targets
|
||||
|
|
@ -2716,7 +2716,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;
|
||||
|
||||
|
|
@ -3266,7 +3266,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;
|
||||
}
|
||||
}
|
||||
|
|
@ -5414,7 +5414,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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue