fix(player): file WEAPON_SLOT_CHANGED under PaperDollInfo

Blizzard's generated API docs put all three of this file's events in the
PaperDollInfo system (PaperDollInfoDocumentation.lua), so the descriptor
said the wrong system and would have invented a stray "Item" grouping in
the /classicapi browser. Filing it correctly also lines up
PLAYER_EQUIPMENT_CHANGED and UPDATE_INVENTORY_DURABILITY for whenever
they get descriptors of their own.

Same source confirms the payload: the entry carries no Payload field, so
no arguments is right. It is also flagged UniqueEvent where the two
per-slot events are SynchronousEvent -- recorded in the header comment,
since that makes the per-frame coalescing the event's own shape rather
than a local preference.
This commit is contained in:
Brues
2026-09-16 22:25:44 -05:00
parent 0296e0e5a4
commit 56d2dbbc27
+9 -2
View File
@@ -59,7 +59,10 @@
// most one fire per frame via a dirty flag drained on WorldTick, because
// one action can change two weapon slots (a two-hander replacing a
// one-hander plus an off-hand) and the per-slot observer would otherwise
// fire twice for it. With no payload there's nothing to lose by merging.
// fire twice for it. With no payload there's nothing to lose by merging —
// and Blizzard's generated docs flag this event `UniqueEvent`, where the
// two per-slot events above are `SynchronousEvent`, so coalescing is the
// event's own shape rather than a local preference.
// Slot 18 is exempted for the classes whose slot 18 is a RELIC slot
// (Libram / Idol / Totem) — see IsWeaponSlot.
@@ -85,9 +88,13 @@ const Event::Custom::AutoReserve _r{kEvtEquipmentChanged};
constexpr const char *kEvtDurability = "UPDATE_INVENTORY_DURABILITY";
const Event::Custom::AutoReserve _r2{kEvtDurability};
// System per Blizzard's own generated docs, where all three of this
// file's events live (PaperDollInfoDocumentation.lua) — so documenting
// PLAYER_EQUIPMENT_CHANGED / UPDATE_INVENTORY_DURABILITY later puts them
// in the same place.
constexpr const char *kEvtWeaponSlotChanged = "WEAPON_SLOT_CHANGED";
const Game::Doc::Event kWeaponSlotChangedDoc{
"Item",
"PaperDollInfo",
"Fires when the item in a weapon slot changes: main hand, off hand, or "
"ranged.",
{}};