Core/Unit: Creatures' minions now engage in combat if their controller is attacked

Port From (https://github.com/TrinityCore/TrinityCore/commit/adfb05055141829620487234e665754d8d957e20)
This commit is contained in:
hondacrx
2022-03-03 13:22:09 -05:00
parent 3f8c0f897a
commit 2a2860ef10
+2 -4
View File
@@ -2353,8 +2353,6 @@ 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))
{
// Signal to pets that their owner was attacked - except when DOT. // Signal to pets that their owner was attacked - except when DOT.
if (attacker != victim && damagetype != DamageEffectType.DOT) if (attacker != victim && damagetype != DamageEffectType.DOT)
{ {
@@ -2370,9 +2368,9 @@ namespace Game.Entities
} }
} }
if (victim.ToPlayer().GetCommandStatus(PlayerCommandStates.God)) Player player = victim.ToPlayer();
if (player != null && player.GetCommandStatus(PlayerCommandStates.God))
return 0; return 0;
}
if (damagetype != DamageEffectType.NoDamage) if (damagetype != DamageEffectType.NoDamage)
{ {