fix: Fixes pets from attacking themselves (Again) (#2267)
This commit is contained in:
parent
5667017874
commit
6cabac5a4f
3 changed files with 8 additions and 24 deletions
|
|
@ -624,14 +624,6 @@ public class MageAI : BaseAI
|
|||
var c = Mobile.Combatant;
|
||||
Mobile.Warmode = true;
|
||||
|
||||
if (Mobile.Controlled && c == Mobile)
|
||||
{
|
||||
DebugSay("I should not attack myself!");
|
||||
Mobile.Combatant = null;
|
||||
Action = ActionType.Guard;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (c?.Deleted != false || !c.Alive || c.IsDeadBondedPet || !Mobile.CanSee(c) ||
|
||||
!Mobile.CanBeHarmful(c, false) || c.Map != Mobile.Map)
|
||||
{
|
||||
|
|
@ -721,6 +713,14 @@ public class MageAI : BaseAI
|
|||
}
|
||||
else if (Mobile.Spell == null && Core.TickCount - _nextCastTime >= 0)
|
||||
{
|
||||
if (Mobile.Controlled && c == Mobile)
|
||||
{
|
||||
DebugSay("I should not attack myself!");
|
||||
Mobile.Combatant = null;
|
||||
Action = ActionType.Guard;
|
||||
return true;
|
||||
}
|
||||
|
||||
// We are ready to cast a spell
|
||||
Spell spell;
|
||||
var toDispel = FindDispelTarget(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue