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

@ -46,6 +46,38 @@ Copy this block when adding a new issue:
---
## #205 — Auto Target clears the toolbar and includes friendly creatures
**Status:** DONE — 2026-07-12, user confirmed the replacement target appears correctly
**Severity:** HIGH
**Component:** combat / selection / retained toolbar
**Description:** After a selected monster died, Auto Target correctly selected
and marked a replacement on the radar, but the selected-object strip remained
empty. The closest-target scan could also select friendly NPCs because it
treated every live creature as a combat candidate.
**Root cause:** `CombatTargetController` subscribes before the retained toolbar.
On the death-driven clear it selected a replacement reentrantly; the toolbar
processed that nested selection, then processed the outer captured Clear
transition and erased itself. Retail selection notices carry no object id, so
`gmToolbarUI::HandleSelectionChanged` reads the current global selection and
cannot consume that stale payload. Separately, the scan used `ItemType.Creature`
instead of retail's `ObjectIsAttackable` combat gate.
**Resolution:** The toolbar notice consumer now reads the canonical live
`SelectionState`, matching retail's payload-free notice. Automatic acquisition
uses a pure Core policy built on the ported `ObjectIsAttackable` predicate and
rejects friendly NPCs, pets, players, corpses, and non-creatures. The deliberate
player exclusion is recorded as IA-19 because retail can include attackable PK
players through its broader `SELECTION_TYPE_COMPASS_ITEM` fallback.
**Research:** `docs/research/2026-07-12-death-and-auto-target-pseudocode.md`
**Acceptance:** With Auto Target enabled, kill several monsters near a friendly
NPC. Every replacement target appears both on radar and in the toolbar; only a
living hostile monster is acquired.
## #204 — Replacement corpses replay the death transition and stand back up
**Status:** DONE — 2026-07-12, user visually confirmed multiple corpses remain fallen