mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 13:47:23 +01:00
*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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user