mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[10563] Implement CMSG_PET_STOP_ATTACK.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
98f36e4652
commit
f9fcf5e055
4 changed files with 29 additions and 2 deletions
|
|
@ -272,6 +272,32 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
|||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetStopAttack(WorldPacket& recv_data)
|
||||
{
|
||||
DEBUG_LOG("WORLD: Received CMSG_PET_STOP_ATTACK");
|
||||
|
||||
ObjectGuid petGuid;
|
||||
recv_data >> petGuid;
|
||||
|
||||
Unit* pet = GetPlayer()->GetMap()->GetUnit(petGuid); // pet or controlled creature/player
|
||||
if (!pet)
|
||||
{
|
||||
sLog.outError("%s doesn't exist.", petGuid.GetString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->GetGUID() != pet->GetCharmerOrOwnerGUID())
|
||||
{
|
||||
sLog.outError("HandlePetStopAttack: %s isn't charm/pet of %s.", petGuid.GetString().c_str(), GetPlayer()->GetObjectGuid().GetString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pet->isAlive())
|
||||
return;
|
||||
|
||||
pet->AttackStop();
|
||||
}
|
||||
|
||||
void WorldSession::HandlePetNameQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DETAIL_LOG( "HandlePetNameQuery. CMSG_PET_NAME_QUERY" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue