From 55981782f0bdad5f80de8feeee793ae7f551e826 Mon Sep 17 00:00:00 2001 From: maximius Date: Tue, 1 Sep 2009 07:06:42 -0700 Subject: [PATCH] *Prevent players from casting spells while getDeathState() == DEAD (this blocks an exploit where players can skip all mobs/doors/etc in an instance and ressurect themselves at boss) --HG-- branch : trunk --- src/game/SpellHandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 13d469c918b..b390becd356 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -289,6 +289,12 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> spellId; recvPacket >> unk_flags; // flags (if 0x02 - some additional data are received) + if(_player->getDeathState() == DEAD) // If DEAD player is casting spells, they're hacking. Better fix would be to prevent this from happening in the first place. + { + recvPacket.rpos(recvPacket.wpos()); // prevent warnings spam + return; + } + // ignore for remote control state (for player case) Unit* mover = _player->m_mover; if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)