Type and name PLAYER_FreeAllCorpseUnits' player and SUNITPROXY_InitNpcTradeItems' table index
Ghidra v1809 · 6c26878
PLAYER_FreeAllCorpseUnits: the EAX parameter nParam is the player unit: the body reads its +0x60 (D2UnitStrc.pInventory, 0x00534970) and walks the corpse list. Its only caller, PLAYER_FreeAllResources(pGame, pUnit) (a player teardown), passes EAX = ESI at 0x005349f6, the same ESI it uses as pUnit (EDX=ESI) for the two calls just before. Retyped to D2UnitStrc * and renamed pPlayer (pUnit is already taken by a local). SUNITPROXY_InitNpcTradeItems: nParam1 is bounds-checked (> 0x10 halts) and used to index gaNpcItemTables[nParam1]; all 15 call sites in SUNITPROXY_AllocNpcControl load a small constant into EAX (e.g. 0xc at 0x00536282, 7 at 0x0053629c). Renamed nNpcTableIdx; type unchanged. The ESI source in PLAYER_FreeAllResources was read from the two preceding calls, not traced to entry.
Changes 3, applied together
Retype variable
win 0x00534970 EAXtypeint32_t→D2UnitStrc *Rename variable
win 0x00534970 EAXnamenParam→pPlayerRename variable
win 0x00535fb0 EAXnamenParam1→nNpcTableIdx