REDIVIVUS

Proposals / #1213

Mac ITEMDROP_DropGoldPiles: name param_2 pUnit, type pItems as D2UnitStrc**, void return

approved · by KierTaylor · submitted 2026-11-05, approved 2026-11-05

Mac 0x001c5d78 (__cdecl) still has a default param_2, an int-typed output array and an undefined return. [EBP+0xc] (param_2) is the unit the piles drop near: passed to UNITS_GetRoom 0x0018f1ae at 0x001c5dab and reused at 0x001c5dd7/0x001c5e34/0x001c5ee4. [EBP+0x14] (pItems) is the base of an output array: at 0x001c5ef6-0x001c5efb the code loads *pCount ([EBP+0x18]) and EDX=[EBP+0x14] to store each created gold item pointer, which the caller SERVERUNIT_GoldAmmountForDeadBody then reads back as units. EAX is not set on exit (RET 0x001c5f1b), so void. The chosen name pItems is kept.

Changes 1, applied together

  1. Set prototype mac 0x001c5d78

    signatureundefined ITEMDROP_DropGoldPiles(D2GameStrc * pGame, D2UnitStrc * param_2, uint nGoldAmount, int pItems, int * pCount, int nMaxCount)→void ITEMDROP_DropGoldPiles(D2GameStrc * pGame, D2UnitStrc * pUnit, uint nGoldAmount, D2UnitStrc * * pItems, int * pCount, int nMaxCount)
    convention__cdecl