*Better fix to dead player with health exploit..

--HG--
branch : trunk
This commit is contained in:
maximius
2009-09-01 10:31:35 -07:00
parent 6c4971ee79
commit 9710187b1a
2 changed files with 8 additions and 6 deletions
+8
View File
@@ -1115,6 +1115,14 @@ void Player::Update( uint32 p_time )
if(!IsInWorld()) if(!IsInWorld())
return; 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 // undelivered mail
if(m_nextMailDelivereTime && m_nextMailDelivereTime <= time(NULL)) if(m_nextMailDelivereTime && m_nextMailDelivereTime <= time(NULL))
{ {
-6
View File
@@ -289,12 +289,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
recvPacket >> spellId; recvPacket >> spellId;
recvPacket >> unk_flags; // flags (if 0x02 - some additional data are received) 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) // ignore for remote control state (for player case)
Unit* mover = _player->m_mover; Unit* mover = _player->m_mover;
if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER) if(mover != _player && mover->GetTypeId()==TYPEID_PLAYER)