aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/SpellHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 7655d2766f3..ce6abe2fdd5 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -16,25 +16,23 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "WorldSession.h"
#include "Common.h"
+#include "Config.h"
#include "DBCStores.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "ObjectMgr.h"
+#include "GameObjectAI.h"
+#include "GameObjectPackets.h"
#include "GuildMgr.h"
-#include "SpellMgr.h"
#include "Log.h"
-#include "Opcodes.h"
-#include "Spell.h"
-#include "Totem.h"
-#include "SpellAuras.h"
+#include "Player.h"
+#include "ObjectMgr.h"
#include "ScriptMgr.h"
-#include "GameObjectAI.h"
+#include "Spell.h"
#include "SpellAuraEffects.h"
-#include "Player.h"
-#include "Config.h"
+#include "SpellMgr.h"
#include "SpellPackets.h"
-#include "GameObjectPackets.h"
+#include "Totem.h"
+#include "TotemPackets.h"
void WorldSession::HandleUseItemOpcode(WorldPackets::Spells::UseItem& packet)
{
@@ -444,18 +442,15 @@ void WorldSession::HandleCancelChanneling(WorldPacket& recvData)
mover->InterruptSpell(CURRENT_CHANNELED_SPELL);
}
-void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
+void WorldSession::HandleTotemDestroyed(WorldPackets::Totem::TotemDestroyed& totemDestroyed)
{
// ignore for remote control state
if (_player->m_mover != _player)
return;
- uint8 slotId;
- ObjectGuid guid;
- recvPacket >> slotId;
- recvPacket >> guid;
+ uint8 slotId = totemDestroyed.Slot;
+ slotId += SUMMON_SLOT_TOTEM;
- ++slotId;
if (slotId >= MAX_TOTEM_SLOT)
return;
@@ -463,7 +458,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
return;
Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]);
- if (totem && totem->IsTotem() && totem->GetGUID() == guid)
+ if (totem && totem->IsTotem() && totem->GetGUID() == totemDestroyed.TotemGUID)
totem->ToTotem()->UnSummon();
}