fix: Prevents recursion in BaseCreature.DoHarmful() (#2202)
This commit is contained in:
parent
8a118170e7
commit
173037ae77
2 changed files with 4 additions and 7 deletions
|
|
@ -8286,7 +8286,7 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
|
|||
Region.OnDidHarmful(this, target);
|
||||
target.Region.OnGotHarmful(this, target);
|
||||
|
||||
if (!indirect)
|
||||
if (!indirect && !ChangingCombatant)
|
||||
{
|
||||
Combatant = target;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2626,13 +2626,10 @@ namespace Server.Mobiles
|
|||
|
||||
if (ai.Defender == target)
|
||||
{
|
||||
if (m_ControlMaster?.Player == true && m_ControlMaster.CanBeHarmful(target, false))
|
||||
var master = GetMaster();
|
||||
if (master?.Player == true && master.CanBeHarmful(target, false))
|
||||
{
|
||||
m_ControlMaster.DoHarmful(target, true);
|
||||
}
|
||||
else if (m_SummonMaster?.Player == true && m_SummonMaster.CanBeHarmful(target, false))
|
||||
{
|
||||
m_SummonMaster.DoHarmful(target, true);
|
||||
master.DoHarmful(target, true);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue