docs: document why ControlOrder fires its handler on every assignment
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 <noreply@anthropic.com>
This commit is contained in:
parent
5d00149dd8
commit
2d07b019af
1 changed files with 4 additions and 0 deletions
|
|
@ -858,6 +858,10 @@ namespace Server.Mobiles
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public Point3D ControlDest { get; set; }
|
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)]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public OrderType ControlOrder
|
public OrderType ControlOrder
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue