mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
*Allow players to control guardians/charms (not only pets).
--HG-- branch : trunk
This commit is contained in:
@@ -53,7 +53,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
if(pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm())
|
||||
if(pet != GetPlayer()->GetFirstControlled())
|
||||
{
|
||||
sLog.outError("HandlePetAction.Pet %u isn't pet of player %s.", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName() );
|
||||
return;
|
||||
@@ -337,14 +337,9 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
|
||||
|
||||
recv_data >> petguid;
|
||||
|
||||
// FIXME: charmed case
|
||||
//Pet* pet = ObjectAccessor::Instance().GetPet(petguid);
|
||||
if(ObjectAccessor::FindPlayer(petguid))
|
||||
return;
|
||||
Unit* pet = ObjectAccessor::GetUnit(*_player, petguid);
|
||||
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid);
|
||||
|
||||
if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm()))
|
||||
if(!pet || pet != _player->GetFirstControlled())
|
||||
{
|
||||
sLog.outError( "HandlePetSetAction: Unknown pet or pet owner." );
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user