mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +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
|
|
@ -3659,7 +3659,7 @@ bool ChatHandler::HandleDieCommand(char* /*args*/)
|
|||
{
|
||||
Unit* target = getSelectedUnit();
|
||||
|
||||
if(!target || !m_session->GetPlayer()->GetSelection())
|
||||
if(!target || m_session->GetPlayer()->GetSelectionGuid().IsEmpty())
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -3687,7 +3687,7 @@ bool ChatHandler::HandleDamageCommand(char* args)
|
|||
|
||||
Unit* target = getSelectedUnit();
|
||||
|
||||
if (!target || !m_session->GetPlayer()->GetSelection())
|
||||
if (!target || m_session->GetPlayer()->GetSelectionGuid().IsEmpty())
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
|
|
@ -5649,16 +5649,16 @@ bool ChatHandler::HandleRespawnCommand(char* /*args*/)
|
|||
|
||||
// accept only explicitly selected target (not implicitly self targeting case)
|
||||
Unit* target = getSelectedUnit();
|
||||
if(pl->GetSelection() && target)
|
||||
if (!pl->GetSelectionGuid().IsEmpty() && target)
|
||||
{
|
||||
if(target->GetTypeId()!=TYPEID_UNIT)
|
||||
if (target->GetTypeId() != TYPEID_UNIT)
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(target->isDead())
|
||||
if (target->isDead())
|
||||
((Creature*)target)->Respawn();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue