Core/Commands: Fix .cheat god command letting you die

author: jackpoz @ tc
This commit is contained in:
AbraKabastard 2019-05-09 23:08:16 -03:00
parent fe908c6a20
commit 0cebc5bbba

View file

@ -931,10 +931,10 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
else if (IsAIEnabled)
ToCreature()->AI()->DamageDealt(victim, damage, damagetype);
if (victim->GetTypeId() == TYPEID_PLAYER && this != victim)
if (victim->GetTypeId() == TYPEID_PLAYER)
{
// Signal to pets that their owner was attacked - except when DOT.
if (damagetype != DOT)
if (this != victim && damagetype != DOT)
{
Pet* pet = victim->ToPlayer()->GetPet();