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

Fix .cheat god command still letting you die with Area Aura like Slime near Thaddius, broken since 777b287dff

# Conflicts:
#	src/server/game/Entities/Unit/Unit.cpp
This commit is contained in:
jackpoz
2019-04-27 14:40:28 +02:00
committed by Ovahlord
parent 0020ea9f92
commit a730e17a37

View File

@@ -768,10 +768,10 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
// Hook for OnDamage Event
sScriptMgr->OnDamage(this, victim, damage);
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 (attacker != victim && damagetype != DOT)
{
for (Unit* controlled : victim->m_Controlled)
if (Creature* cControlled = controlled->ToCreature())