ModernUO/Projects
Kamron Batman 5d00149dd8
fix: keep the Guard order through combat and sprint guard returns
A guarding pet's engagement path (FindCombatant) rewrote ControlOrder to
Attack, so guard silently converted to a plain kill order mid-fight (#2595):
the (guarding)/guarded OPL tags vanished, the pet stopped scanning for the
master's threats and never retargeted, recall/gate left it behind
(TeleportPets only takes Guard/Follow/Come), and every engage->kill->resume
cycle replayed the "is now guarding you" flourish. Return pacing also
depended on stale Warmode, leaving guard returns active or passive by combat
history.

- FindCombatant is now FindGuardTarget: a pure selector that prefers the
  aggressor closest to the master (RunUO guard parity) and keeps the current
  combatant unless a strictly closer one exists. DoOrderGuard engages through
  it without ever leaving the Guard order.
- HandleInvalidControlTarget resumes the persistent order first and chains
  the next aggressor into an explicit Attack only for non-guard fallbacks —
  an explicit "all attack" completes, returns to guarding, and the guard scan
  takes over. Resuming Guard no longer replays the sound/message flourish.
- The peaceful guard branch stands down (Warmode/Combatant/FocusMob cleared)
  so pacing is deterministic, and guard returns sprint at the follow pace
  (0.1s/step, AOS) on the move clock while the think cadence is untouched.
- WalkMobileRange honors the caller's run flag instead of a hardcoded
  distance-5 gate; follow/guard run animation now matches their actual pace.

Closes #2595

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 07:06:09 -07:00
..
Application fix: Bumps dependencies. (#2531) 2026-07-14 15:17:55 -07:00
BuildTool feat: Bumps dependencies. Introduces Serialization Generator v3 (#2584) 2026-08-22 15:48:53 -07:00
Logger fix: Bumps dependencies. (#2531) 2026-07-14 15:17:55 -07:00
Server feat: convert all delta-time serialization to anchored time (#2589) 2026-08-22 19:34:43 -07:00
Server.Tests feat: convert all delta-time serialization to anchored time (#2589) 2026-08-22 19:34:43 -07:00
UOContent fix: keep the Guard order through combat and sprint guard returns 2026-08-25 07:06:09 -07:00
UOContent.Tests fix: keep the Guard order through combat and sprint guard returns 2026-08-25 07:06:09 -07:00