From 2d07b019af8bf8c23d7978b3a7b8f6cae76ed959 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Tue, 25 Aug 2026 09:06:27 -0700 Subject: [PATCH] docs: document why ControlOrder fires its handler on every assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed whether OnCurrentOrderChanged should be change-guarded: it must not be. A reissued order is a command — "all attack" retargets through ControlTarget with the same order value, "all follow" breaks off combat, "all stay" re-anchors Home — and each depends on the handler running (and, since #2594, on the AI being prodded awake). No code path writes the same value on a hot path; all AI-internal writes are genuine transitions, so same-value fires only occur at player-command rate. Handlers that need change-detection already receive the previous order (ResolveStop uses it). Co-Authored-By: Claude Fable 5 --- Projects/UOContent/Mobiles/BaseCreature.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Projects/UOContent/Mobiles/BaseCreature.cs b/Projects/UOContent/Mobiles/BaseCreature.cs index 25045df1e..4fbdf6561 100644 --- a/Projects/UOContent/Mobiles/BaseCreature.cs +++ b/Projects/UOContent/Mobiles/BaseCreature.cs @@ -858,6 +858,10 @@ namespace Server.Mobiles [CommandProperty(AccessLevel.GameMaster)] public Point3D ControlDest { get; set; } + // Deliberately fires on every assignment, not just changes: a reissued order is a + // command ("all attack" retargets via ControlTarget, "all follow" breaks off combat, + // "all stay" re-anchors Home) and must run its handler and wake the AI. Handlers + // needing change-detection compare against the previous order they receive. [CommandProperty(AccessLevel.GameMaster)] public OrderType ControlOrder {