fix(combat): synchronize auto-target presentation

Make the retained toolbar consume retail's payload-free selection notice from canonical live state so a reentrant Auto Target replacement cannot be erased by the outer clear. Restrict automatic acquisition to the requested hostile non-player monster policy and record the intentional PK edge divergence.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-12 20:26:00 +02:00
parent 8be933fc94
commit 0f2d98c501
11 changed files with 225 additions and 7 deletions

View file

@ -142,3 +142,37 @@ quality, so its existing closest eligible creature scan implements the
fallback branch. The important lifecycle behavior is exact: authoritative
death clears selection, and the SelectionChanged consumer reacquires only
when Auto Target is enabled in Melee/Missile combat.
### Selection-notice reentrancy
Retail's selection notice has no selected-object payload:
```text
ACCWeenieObject::SetSelectedObject(newId):
selectedID = newId
CM_UI::SendNotice_SelectionChanged()
CM_UI::SendNotice_SelectionChanged():
for each registered handler:
handler.RecvNotice_SelectionChanged()
gmToolbarUI::HandleSelectionChanged():
id = ACCWeenieObject::selectedID // read current global state
clear and repopulate selected-object strip from id
```
If `ClientCombatSystem::RecvNotice_SelectionChanged` runs first for a clear,
its `AutoTarget()` may select a replacement reentrantly. A later toolbar
handler reads the replacement from global state; it does not receive and apply
the stale outer clear. acdream's retained toolbar must likewise read the
canonical `SelectionState.SelectedObjectId` when notified rather than use the
captured transition payload.
### acdream automatic monster narrowing
Retail's combat-mode `SelectNext(COMPASS_ITEM)` rejects candidates that fail
`ClientCombatSystem::ObjectIsAttackable @ 0x0056A600`; that predicate rejects
friendly NPCs, pets, corpses, and non-creatures but can accept enemy players in
compatible PK states. By explicit product direction, acdream narrows automatic
acquisition further to non-player hostile monsters. Manual player selection
remains separate. This intentional PK edge divergence is register IA-19.