[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
2009-04-20 20:28:19 -05:00
parent b4046ddf88
commit fc7e1db9fb
28 changed files with 140 additions and 163 deletions

View File

@@ -234,7 +234,7 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
if(_player->m_mover != _player)
return;
GameObject *obj = ObjectAccessor::GetGameObject(*_player, guid);
GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid);
if(!obj)
return;
@@ -258,7 +258,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
if(_player->m_mover != _player)
return;
GameObject* go = ObjectAccessor::GetGameObject(*_player,guid);
GameObject* go = GetPlayer()->GetMap()->GetGameObject(guid);
if(!go)
return;
@@ -480,7 +480,7 @@ void WorldSession::HandleTotemDestroy( WorldPacket& recvPacket)
if(!_player->m_SummonSlot[slotId])
return;
Creature* totem = ObjectAccessor::GetCreature(*_player,_player->m_SummonSlot[slotId]);
Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]);
// Don't unsummon sentry totem
if(totem && totem->isTotem() && totem->GetEntry() != SENTRY_TOTEM_ENTRY)
((Totem*)totem)->UnSummon();