mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[10627] Use ObjectGuid for player's selection and unit's target
This commit is contained in:
parent
e74d56f9d2
commit
c955941b55
21 changed files with 66 additions and 73 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue