The player's Attack runs the attack validator's target pick: a friend selected retargets the nearest enemy in call order, a corpse or a fruitless scan says "You cannot attack that target.", nothing selected and no enemy says "There is nothing to attack." (#249) (#501)
The player's Attack (the Attack Target key, `AttackTarget()` and the Attack action button) now picks its target as 1.12.1's validator `0x612df0` does, where before it swung at whatever was selected, a friendly unit or a corpse included. - With nothing selected, or a unit the player is friendly toward (reaction ≥ 4, `0x6130a3`), it runs the Tab cycler for the nearest enemy (`0x6130b5` → `0x493f60`), which commits the new selection at once, so `AttackTarget()` then `/cast` in one script casts at the new target. - It then reads the selection again (`0x6130c1`): none raises "There is nothing to attack." (`0x6130d9`); a unit neither alive nor feigning, or one `CanAttack` (`0x606980`) rejects, raises "You cannot attack that target." (`0x613171`). A friendly unit with no enemy near stays selected and meets that second gate. - The swing toggle runs only once a target is accepted (`0x6131a0`), so Attack at a corpse mid-swing gives the error and keeps the swing. - The pet's attack order shares the same pick. vmangos stops a swing at a friendly or dead target server-side (`CombatHandler.cpp:46-59`), which the client no longer sends. Fixes #249 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c6767d6a79
commit
bacbb791db
@@ -24,8 +24,8 @@ pub enum ScriptCall {
|
||||
TargetLastTarget,
|
||||
/// `ClearTarget()` (`0x489ff0` → `0x493540(0,0)`), a no-op when nothing is selected by then.
|
||||
ClearTarget,
|
||||
/// `AttackTarget()` (`0x489b50` → `0x6131a0(0,0)`): the attack toggle at the selection as it
|
||||
/// stands then.
|
||||
/// `AttackTarget()` (`0x489b50` → `0x6131a0(0,0)`): the attack validator's pick from the
|
||||
/// selection as it stands then, which may move it to the nearest enemy, then the toggle.
|
||||
AttackTarget,
|
||||
/// `SpellTargetUnit(unit)` (`0x6e6d90`), made while the cursor was up.
|
||||
SpellTargetUnit(String),
|
||||
|
||||
Reference in New Issue
Block a user