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

Port From (https://github.com/TrinityCore/TrinityCore/commit/519e3c9ab718ce50dbaf66a50d15f5ead2dc9885)
This commit is contained in:
hondacrx
2021-12-01 22:59:43 -05:00
parent 7f5dfd0025
commit 0f030d61cf
+2 -2
View File
@@ -2366,10 +2366,10 @@ namespace Game.Entities
// Hook for OnDamage Event // Hook for OnDamage Event
Global.ScriptMgr.OnDamage(attacker, victim, ref damage); Global.ScriptMgr.OnDamage(attacker, victim, ref damage);
if (victim.IsTypeId(TypeId.Player) && attacker != victim) if (victim.IsTypeId(TypeId.Player))
{ {
// Signal to pets that their owner was attacked - except when DOT. // Signal to pets that their owner was attacked - except when DOT.
if (damagetype != DamageEffectType.DOT) if (attacker != victim && damagetype != DamageEffectType.DOT)
{ {
foreach (Unit controlled in victim.m_Controlled) foreach (Unit controlled in victim.m_Controlled)
{ {