REDIVIVUS

Proposals / #1254

Mac FindPartyControlSub: D2UnitPartyControlSub* __fastcall (D2GameStrc* pGame ECX, int16_t nPartyId DX)

checked · by KierTaylor · submitted 2026-11-06

The Mac body reads ECX (pGame; pPartyControl at +0x1d2c, with an internal-error halt if NULL) and EDX (saved to ESI, its low word compared with each sub's word at +0 as the party id). It walks the sub list through +8 and returns the matching sub (or 0) in EAX, then a plain RET. Callers load ECX/EDX (PARTY_AddUnitToParty 0x00276a93: MOV ECX,ESI with EDX = MOVZX of the party id) and use EAX. Matches the Windows twin 0x00540290 (pGame, int16_t nPartyId -> D2UnitPartyControlSub*), which there takes EAX/CX.

Changes 1, applied together

  1. Set prototype mac 0x00276c1e

    signatureundefined FindPartyControlSub(void)→D2UnitPartyControlSub* FindPartyControlSub(D2GameStrc* pGame, int16_t nPartyId)
    conventionunknown→__fastcall