fix: fixes mobiles pathing home after combat (#2246)

This commit is contained in:
Bohica 2025-07-26 10:11:31 -07:00 committed by GitHub
parent fa0b67ec29
commit f59605190c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -439,11 +439,14 @@ public abstract partial class BaseAI
public virtual bool DoActionGuard() public virtual bool DoActionGuard()
{ {
DebugSay("I am still on guard."); if (Mobile.Combatant == null)
if (Utility.Random(10) == 0)
{ {
Mobile.Turn(Utility.Random(0, 2) - 1); DebugSay("No threats found. Going home...");
Action = ActionType.Wander;
} }
DebugSay("I stopped being on guard.");
Action = ActionType.Wander;
return true; return true;
} }