REDIVIVUS

Proposals / #747

Return the complete item pointer from the Mac matching-book search

applied · by Commit-Will · submitted 2026-11-01, applied 2026-11-02

Ghidra vmac 109 · 39698f0

The complete325-byte search returns null or a matching existing item unit. It starts at grid.pFirstItem (typed D2UnitStrc*) and advances via D2UnitDataItemStrc.pNextItemInPage+112, with UNIT_ITEM checks and unit-data+20 validation. A successful search moves the unadjusted item pointer into ESI and returns it in full EAX. Temporary suffix/quantity values in SI/ESI are cleared or replaced before every return; none escapes as the result. Windows0063c3b0 has the same search and D2UnitStrc* return. Both Mac code callers are in the complete3090-byte pickup routine and use the result as an item for scroll stacking. Restore only the return, preserving all three existing pointer parameters, chosen names, cdecl and stack slots. Existing layouts and all original calls checked; no field, caller, source, runtime or matching change.

Changes 1, applied together

  1. Set prototype mac 0x00168ad3

    signatureundefined INVENTORY_FindFillableBook(D2InventoryStrc * pInventory, D2UnitStrc * pItem, D2UnitStrc * pStartItem)→D2UnitStrc * INVENTORY_FindFillableBook(D2InventoryStrc * pInventory, D2UnitStrc * pItem, D2UnitStrc * pStartItem)
    convention__cdecl