diff options
author | megamage <none@none> | 2009-03-21 10:17:24 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-21 10:17:24 -0600 |
commit | a54957ba4193f439df86d7d02bb41b918cea529b (patch) | |
tree | dcf18bc87836b4f1217276958e46b57b19763f48 | |
parent | 6a8c9c001dce3172e15b619128782eca6b3685da (diff) |
*Allow players to control guardians/charms (not only pets).
--HG--
branch : trunk
-rw-r--r-- | src/game/PetHandler.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index cc560412bbb..5fbd1f69916 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -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; - - Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid); + Unit* pet = ObjectAccessor::GetUnit(*_player, petguid); - if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm())) + if(!pet || pet != _player->GetFirstControlled()) { sLog.outError( "HandlePetSetAction: Unknown pet or pet owner." ); return; |