Files
Kelsi 9b3cb1bf72 feat(pet): let a companion be dismissed by pressing it again
There was no way to put a companion away. It has no aura, so nothing appears in
the buff bar to right-click, and pressing it in the spellbook only ever summoned
— producing the same critter again. CMSG_DISMISS_CRITTER was in the opcode
tables and nothing sent it.

A companion announces itself only through UNIT_FIELD_CRITTER on the player, so
that field is now read and the guid remembered along with the spell that called
it, identified the same way the mount aura is: the spell just cast from the
ground, rather than a guess at "some spell", which would fire the toggle on the
wrong button. Casting that spell again dismisses instead of summoning.

The local state is left alone until the server clears the field, so a dismiss it
refuses does not leave the client believing the companion is gone.

WotLK only, on both halves: no earlier expansion publishes the field or carries
the opcode. On those the field index resolves to missing and nothing changes.

Tested by pinning the field index against neighbours whose values are
independently known — a wrong index here would not fail, it would quietly read
whatever sits at that offset and hand the dismiss a guid that is not a
companion — and by asserting the older expansions claim no index at all.
2026-07-31 22:21:49 -07:00
..