diff options
author | Carbenium <carbenium@outlook.com> | 2016-02-02 01:38:29 +0100 |
---|---|---|
committer | Carbenium <carbenium@outlook.com> | 2016-02-02 01:38:29 +0100 |
commit | 5b313bf74d00f46d4d1ce006cd8274e6cbd14286 (patch) | |
tree | 20ca39c989a15499fcd07055951c5a9b0ec668ea /src/server/game/Handlers/SpellHandler.cpp | |
parent | 0b763812833be6802bcc63955d9b4531268960e7 (diff) |
Core/PacketIO: Updated and enabled CMSG_PET_CANCEL_AURA
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/SpellHandler.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index b58e2fca69e..cbbb468938e 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -367,32 +367,26 @@ void WorldSession::HandleCancelAuraOpcode(WorldPackets::Spells::CancelAura& canc } } -void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) +void WorldSession::HandlePetCancelAuraOpcode(WorldPackets::Spells::PetCancelAura& packet) { - ObjectGuid guid; - uint32 spellId; - - recvPacket >> guid; - recvPacket >> spellId; - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(packet.SpellID); if (!spellInfo) { - TC_LOG_ERROR("network", "WORLD: unknown PET spell id %u", spellId); + TC_LOG_ERROR("network", "WORLD: unknown PET spell id %u", packet.SpellID); return; } - Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); + Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, packet.PetGUID); if (!pet) { - TC_LOG_ERROR("network", "HandlePetCancelAura: Attempt to cancel an aura for non-existant %s by player '%s'", guid.ToString().c_str(), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "HandlePetCancelAura: Attempt to cancel an aura for non-existant %s by player '%s'", packet.PetGUID.ToString().c_str(), GetPlayer()->GetName().c_str()); return; } if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm()) { - TC_LOG_ERROR("network", "HandlePetCancelAura: %s is not a pet of player '%s'", guid.ToString().c_str(), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "HandlePetCancelAura: %s is not a pet of player '%s'", packet.PetGUID.ToString().c_str(), GetPlayer()->GetName().c_str()); return; } @@ -402,7 +396,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) return; } - pet->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL); + pet->RemoveOwnedAura(packet.SpellID, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL); } void WorldSession::HandleCancelGrowthAuraOpcode(WorldPackets::Spells::CancelGrowthAura& /*cancelGrowthAura*/) |