mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
autoStand / autoDismount / autoUnshift ran their actions as soon as the caster-state check (CheckCasterStateForSpell, 0x006094F0) passed. In the 1.12.1 cast request (TryCastSpell, 0x006E4B60) that check comes before the target arm (0x006E5250), so a cast that then found no target still dismounted the player and showed "You have no target" (Charge with nothing targeted). A targeting cursor the player cancelled did the same. The caster check now only keeps what its rungs noted, and the actions run at the send. SendCast (0x006E54F0) builds the cast packet; its five callers all pass the global pending cast: the arm's two immediate sends and the object / location / trade-slot binders, which the targeting cursor's click also runs. The arm's only caller is the cast request, after the caster check, so every send follows a check of the same cast. Each action runs only if its state still holds, since the player can stand, dismount or leave the form while the cursor is up. The send redirects must all apply before the rungs are patched. Item use had the same ordering gap. Its form refusal (0x005D914D) comes before the toggle test, which turns off a use aura that is already up instead of casting (0x005D9157..0x005D9237). Re-using such an item while shapeshifted dropped the form as well. The refusal now only notes the unshift; it runs at the bind-on-use test (0x005D91D3), which every path past the toggle reaches, and the toggle's cancel call clears it. Fixes #132