diff options
author | Shauren <shauren.trinity@gmail.com> | 2019-06-03 20:40:34 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-06-08 17:06:57 +0200 |
commit | 455959c6064af6f7863a6b4b57cb0ef1646bd8ef (patch) | |
tree | 7d7a7cdd3a44643ee5fc7d19521ced1c8b815c66 /src/server/game/Handlers/PetHandler.cpp | |
parent | 31fda79556e55375962a3c9e46f6dbdbf6e90d18 (diff) |
Core/PacketIO: Rewrite updatefield handling
Diffstat (limited to 'src/server/game/Handlers/PetHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/PetHandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index d03c811c241..18b69ac2d0b 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -416,7 +416,7 @@ void WorldSession::SendQueryPetNameResponse(ObjectGuid guid) if (Creature* unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid)) { response.Allow = true; - response.Timestamp = unit->GetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP); + response.Timestamp = unit->m_unitData->PetNameTimestamp; response.Name = unit->GetName(); if (Pet* pet = unit->ToPet()) @@ -446,7 +446,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid) // stable master case else { - if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER)) + if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER, UNIT_NPC_FLAG_2_NONE)) { TC_LOG_DEBUG("entities.player", "Stablemaster %s not found or you can't interact with him.", guid.ToString().c_str()); return false; @@ -523,7 +523,7 @@ void WorldSession::HandlePetRename(WorldPackets::Pet::PetRename& packet) Pet* pet = ObjectAccessor::GetPet(*_player, petguid); // check it! if (!pet || !pet->IsPet() || ((Pet*)pet)->getPetType() != HUNTER_PET || - !pet->HasByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PET_FLAGS, UNIT_CAN_BE_RENAMED) || + !pet->HasPetFlag(UNIT_PET_FLAG_CAN_BE_RENAMED) || pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo()) return; @@ -544,7 +544,7 @@ void WorldSession::HandlePetRename(WorldPackets::Pet::PetRename& packet) pet->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME); - pet->RemoveByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PET_FLAGS, UNIT_CAN_BE_RENAMED); + pet->RemovePetFlag(UNIT_PET_FLAG_CAN_BE_RENAMED); if (declinedname) { @@ -584,7 +584,7 @@ void WorldSession::HandlePetRename(WorldPackets::Pet::PetRename& packet) CharacterDatabase.CommitTransaction(trans); - pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped + pet->SetPetNameTimestamp(uint32(time(NULL))); } void WorldSession::HandlePetAbandon(WorldPackets::Pet::PetAbandon& packet) |