*Allow players to control guardians/charms (not only pets).

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-21 10:17:24 -06:00
parent 6a8c9c001d
commit a54957ba41

View File

@@ -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;