REDIVIVUS

Proposals / #1202

Mac PARTY_ForEachPartyMember: void return, typed callback (fpExecuteOnUnitFunction*) and void* pArg

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

Mac 0x00276faf is __cdecl but its return is "undefined" and the callback/arg are untyped (undefined*, undefined4). The body calls [EBP+0x10] indirectly (CALL EBX at 0x00277005) with [ESP]=pGame, [ESP+4]=member player unit (from 0x0027905c), [ESP+8]=[EBP+0x14] (pArg): exactly fpExecuteOnUnitFunction (BOOL __cdecl (D2GameStrc*, D2UnitStrc*, int32_t)), the type IteratePlayerOrMonsterUnits already uses. The callback result is ignored and EAX is not set on the exit paths (0x0027700e), so the function returns void. Callers such as Q21_PartySetGoldenBirdState pass 4 dwords.

Changes 1, applied together

  1. Set prototype mac 0x00276faf

    signatureundefined PARTY_ForEachPartyMember(D2GameStrc * pGame, short nPartyId, undefined * pfnCallback, undefined4 pArg)→void PARTY_ForEachPartyMember(D2GameStrc * pGame, short nPartyId, fpExecuteOnUnitFunction * pfnCallback, void * pArg)
    convention__cdecl