mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04: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
|
|
@ -230,7 +230,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;
|
||||
|
|
@ -254,7 +254,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;
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ void WorldSession::HandleTotemDestroy( WorldPacket& recvPacket)
|
|||
if(!_player->m_TotemSlot[slotId])
|
||||
return;
|
||||
|
||||
Creature* totem = ObjectAccessor::GetCreature(*_player,_player->m_TotemSlot[slotId]);
|
||||
Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_TotemSlot[slotId]);
|
||||
if(totem && totem->isTotem())
|
||||
((Totem*)totem)->UnSummon();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue