mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[8718] Remove most GetObjectInWorld functions and move some map local to Map
Also mape pet guid counter per-map (in different expecte to be global pet number)
This commit is contained in:
parent
40b0a2cd92
commit
d7ae5e3af0
20 changed files with 135 additions and 132 deletions
|
|
@ -380,9 +380,9 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
|||
recv_data >> name;
|
||||
recv_data >> isdeclined;
|
||||
|
||||
Pet* pet = ObjectAccessor::GetPet(petguid);
|
||||
Pet* pet = _player->GetMap()->GetPet(petguid);
|
||||
// check it!
|
||||
if( !pet || !pet->isPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET ||
|
||||
if( !pet || pet->getPetType() != HUNTER_PET ||
|
||||
pet->GetByteValue(UNIT_FIELD_BYTES_2, 2) != UNIT_RENAME_ALLOWED ||
|
||||
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo() )
|
||||
return;
|
||||
|
|
@ -402,9 +402,8 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
|||
|
||||
pet->SetName(name);
|
||||
|
||||
Unit *owner = pet->GetOwner();
|
||||
if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
|
||||
((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME);
|
||||
if(_player->GetGroup())
|
||||
_player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME);
|
||||
|
||||
pet->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue