fix: visible item field base 408→286 (computed from INV_SLOT_HEAD=324)

PLAYER_VISIBLE_ITEM_1_ENTRYID = PLAYER_FIELD_INV_SLOT_HEAD(324) - 19*2
= 286. The previous value of 408 landed far past inventory slots in
string/name data, producing garbage entry IDs (ASCII fragments like
"mant", "alk ", "ryan") that the server rejected as invalid items.

Derivation: 19 visible item slots × 2 fields (entry + enchant) = 38
fields immediately before PLAYER_FIELD_INV_SLOT_HEAD at index 324.
This commit is contained in:
Kelsi 2026-03-28 10:58:34 -07:00
parent 37300d65ce
commit f70beba07c

View file

@ -2568,10 +2568,10 @@ private:
// Visible equipment for other players: detect the update-field layout (base + stride)
// using the local player's own equipped items, then decode other players by index.
// WotLK 3.3.5a: PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END(148) + 0x0104 = 408, stride 2.
// Previous value 284 (UNIT_END+136) was wrong — landed in quest log fields.
// WotLK 3.3.5a: PLAYER_VISIBLE_ITEM_1_ENTRYID = PLAYER_FIELD_INV_SLOT_HEAD(324) - 19*2 = 286.
// 19 visible item slots × 2 fields (entry + enchant) = 38 fields before inventory.
// The heuristic in maybeDetectVisibleItemLayout() can still override if needed.
int visibleItemEntryBase_ = 408;
int visibleItemEntryBase_ = 286;
int visibleItemStride_ = 2;
bool visibleItemLayoutVerified_ = false; // true once heuristic confirms/overrides default
std::unordered_map<uint64_t, std::array<uint32_t, 19>> otherPlayerVisibleItemEntries_;