[10627] Use ObjectGuid for player's selection and unit's target

This commit is contained in:
VladimirMangos 2010-10-20 08:15:30 +04:00
parent e74d56f9d2
commit c955941b55
21 changed files with 66 additions and 73 deletions

View file

@ -1156,7 +1156,7 @@ void ChatHandler::ExecuteCommand(const char* text)
if (m_session)
{
Player* p = m_session->GetPlayer();
ObjectGuid sel_guid = p->GetSelection();
ObjectGuid sel_guid = p->GetSelectionGuid();
sLog.outCommand(GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected: %s]",
fullcmd.c_str(),p->GetName(),GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
sel_guid.GetString().c_str());
@ -2012,9 +2012,9 @@ Player * ChatHandler::getSelectedPlayer()
if(!m_session)
return NULL;
uint64 guid = m_session->GetPlayer()->GetSelection();
ObjectGuid guid = m_session->GetPlayer()->GetSelectionGuid();
if (guid == 0)
if (guid.IsEmpty())
return m_session->GetPlayer();
return sObjectMgr.GetPlayer(guid);
@ -2025,9 +2025,9 @@ Unit* ChatHandler::getSelectedUnit()
if(!m_session)
return NULL;
uint64 guid = m_session->GetPlayer()->GetSelection();
ObjectGuid guid = m_session->GetPlayer()->GetSelectionGuid();
if (guid == 0)
if (guid.IsEmpty())
return m_session->GetPlayer();
// can be selected player at another map
@ -2039,7 +2039,7 @@ Creature* ChatHandler::getSelectedCreature()
if(!m_session)
return NULL;
return m_session->GetPlayer()->GetMap()->GetAnyTypeCreature(m_session->GetPlayer()->GetSelection());
return m_session->GetPlayer()->GetMap()->GetAnyTypeCreature(m_session->GetPlayer()->GetSelectionGuid());
}
/**