mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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
|
|
@ -5432,7 +5432,7 @@ void Spell::EffectSummonTotem(uint32 i)
|
|||
uint64 guid = m_caster->m_TotemSlot[slot];
|
||||
if(guid != 0)
|
||||
{
|
||||
Creature *OldTotem = ObjectAccessor::GetCreature(*m_caster, guid);
|
||||
Creature *OldTotem = m_caster->GetMap()->GetCreature(guid);
|
||||
if(OldTotem && OldTotem->isTotem())
|
||||
((Totem*)OldTotem)->UnSummon();
|
||||
}
|
||||
|
|
@ -5632,7 +5632,7 @@ void Spell::EffectSummonObject(uint32 i)
|
|||
{
|
||||
GameObject* obj = NULL;
|
||||
if( m_caster )
|
||||
obj = ObjectAccessor::GetGameObject(*m_caster, guid);
|
||||
obj = m_caster->GetMap()->GetGameObject(guid);
|
||||
|
||||
if(obj) obj->Delete();
|
||||
m_caster->m_ObjectSlot[slot] = 0;
|
||||
|
|
@ -6114,7 +6114,7 @@ void Spell::EffectDestroyAllTotems(uint32 /*i*/)
|
|||
if(!m_caster->m_TotemSlot[slot])
|
||||
continue;
|
||||
|
||||
Creature* totem = ObjectAccessor::GetCreature(*m_caster,m_caster->m_TotemSlot[slot]);
|
||||
Creature* totem = m_caster->GetMap()->GetCreature(m_caster->m_TotemSlot[slot]);
|
||||
if(totem && totem->isTotem())
|
||||
{
|
||||
uint32 spell_id = totem->GetUInt32Value(UNIT_CREATED_BY_SPELL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue