mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +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
|
|
@ -3984,7 +3984,7 @@ void Unit::RemoveDynObject(uint32 spellid)
|
|||
return;
|
||||
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
|
||||
{
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*i);
|
||||
DynamicObject* dynObj = GetMap()->GetDynamicObject(*i);
|
||||
if(!dynObj)
|
||||
{
|
||||
i = m_dynObjGUIDs.erase(i);
|
||||
|
|
@ -4003,7 +4003,7 @@ void Unit::RemoveAllDynObjects()
|
|||
{
|
||||
while(!m_dynObjGUIDs.empty())
|
||||
{
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*m_dynObjGUIDs.begin());
|
||||
DynamicObject* dynObj = GetMap()->GetDynamicObject(*m_dynObjGUIDs.begin());
|
||||
if(dynObj)
|
||||
dynObj->Delete();
|
||||
m_dynObjGUIDs.erase(m_dynObjGUIDs.begin());
|
||||
|
|
@ -4014,7 +4014,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId, uint32 effIndex)
|
|||
{
|
||||
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
|
||||
{
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*i);
|
||||
DynamicObject* dynObj = GetMap()->GetDynamicObject(*i);
|
||||
if(!dynObj)
|
||||
{
|
||||
i = m_dynObjGUIDs.erase(i);
|
||||
|
|
@ -4032,7 +4032,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId)
|
|||
{
|
||||
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
|
||||
{
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*i);
|
||||
DynamicObject* dynObj = GetMap()->GetDynamicObject(*i);
|
||||
if(!dynObj)
|
||||
{
|
||||
i = m_dynObjGUIDs.erase(i);
|
||||
|
|
@ -7259,7 +7259,7 @@ bool Unit::isAttackingPlayer() const
|
|||
{
|
||||
if(m_TotemSlot[i])
|
||||
{
|
||||
Creature *totem = ObjectAccessor::GetCreature(*this, m_TotemSlot[i]);
|
||||
Creature *totem = GetMap()->GetCreature(m_TotemSlot[i]);
|
||||
if(totem && totem->isAttackingPlayer())
|
||||
return true;
|
||||
}
|
||||
|
|
@ -7417,7 +7417,7 @@ void Unit::UnsummonAllTotems()
|
|||
if(!m_TotemSlot[i])
|
||||
continue;
|
||||
|
||||
Creature *OldTotem = ObjectAccessor::GetCreature(*this, m_TotemSlot[i]);
|
||||
Creature *OldTotem = GetMap()->GetCreature(m_TotemSlot[i]);
|
||||
if (OldTotem && OldTotem->isTotem())
|
||||
((Totem*)OldTotem)->UnSummon();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue