From f59605190cc21b0254546c47f83e801e82bd6d4b Mon Sep 17 00:00:00 2001 From: Bohica <53943479+Bohicatv@users.noreply.github.com> Date: Sat, 26 Jul 2025 10:11:31 -0700 Subject: [PATCH] fix: fixes mobiles pathing home after combat (#2246) --- Projects/UOContent/Mobiles/AI/BaseAI/BaseAI.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Projects/UOContent/Mobiles/AI/BaseAI/BaseAI.cs b/Projects/UOContent/Mobiles/AI/BaseAI/BaseAI.cs index 02b178dc2..1797cfca6 100644 --- a/Projects/UOContent/Mobiles/AI/BaseAI/BaseAI.cs +++ b/Projects/UOContent/Mobiles/AI/BaseAI/BaseAI.cs @@ -439,11 +439,14 @@ public abstract partial class BaseAI public virtual bool DoActionGuard() { - DebugSay("I am still on guard."); - if (Utility.Random(10) == 0) + if (Mobile.Combatant == null) { - 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; }