*Do not check for charminfo->petnumber when responding to Pet name query

*Send Unknown if pet is not found by object accessor

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-01-30 13:54:34 +01:00
parent f587fd14af
commit a6630824f4

View File

@@ -358,8 +358,16 @@ void WorldSession::HandlePetNameQuery( WorldPacket & recv_data )
void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber)
{
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid);
if(!pet || !pet->GetCharmInfo() || pet->GetCharmInfo()->GetPetNumber() != petnumber)
if(!pet)
{
WorldPacket data(SMSG_PET_NAME_QUERY_RESPONSE, (4+4+name.size()+1));
data << uint32(petnumber);
data << "Unknown";
data << uint32(0);
data << uint8(0);
_player->GetSession()->SendPacket(&data);
return;
}
std::string name = pet->GetName();