From 9710187b1a93e68e74c48f189700fc21710be3fe Mon Sep 17 00:00:00 2001 From: maximius Date: Tue, 1 Sep 2009 10:31:35 -0700 Subject: *Better fix to dead player with health exploit.. --HG-- branch : trunk --- src/game/Player.cpp | 8 ++++++++ src/game/SpellHandler.cpp | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7b229609c30..37362dab4b1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1115,6 +1115,14 @@ void Player::Update( uint32 p_time ) if(!IsInWorld()) return; + if(GetHealth() && (isDead() || HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))) + { + sLog.outError("Player %s(GUID: %u) was dead and had health > 0. This _might_ be an exploit attempt. They have been kicked.", GetName(), GetGUIDLow()); + SetHealth(0); + GetSession()->KickPlayer(); + return; + } + // undelivered mail if(m_nextMailDelivereTime && m_nextMailDelivereTime <= time(NULL)) { diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index b390becd356..13d469c918b 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -289,12 +289,6 @@ 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) -- cgit v1.2.3