fix: Fixes pets from attacking themselves (Again) (#2267)

This commit is contained in:
Bohica 2025-11-15 14:21:18 -08:00 committed by GitHub
parent 5667017874
commit 6cabac5a4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 24 deletions

View file

@ -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);