REDIVIVUS

Proposals / #1269

Mac SUNITINACTIVE_AllocInactiveListForRoom: D2InactiveUnitListStrc* __fastcall (pGame, pRoom, bCreate)

checked · by KierTaylor · submitted 2026-11-06

ECX = pGame (ESI, passed back as ECX to SUNITINACTIVE_AllocOrFindInactiveList). EDX = pRoom (EDI; its coords are read and DRLGROOM level -> act gives the act passed as EDX). [EBP+8] = the create flag, forwarded as the 3rd stack arg. It returns the list pointer from AllocOrFindInactiveList unchanged, and both callers use it: SUNITINACTIVE_RoomInit 0x00281847 does TEST EAX,EAX then reads [EAX+0xc]; SaveInactiveUnit 0x00283509 links into [EAX+0xc]. So the return is the list pointer, even though the Windows twin 0x00541de0 (pGame, bCreate, pRoom) declares void.

Changes 1, applied together

  1. Set prototype mac 0x002839fb

    signatureundefined SUNITINACTIVE_AllocInactiveListForRoom(void)→D2InactiveUnitListStrc* SUNITINACTIVE_AllocInactiveListForRoom(D2GameStrc* pGame, D2RoomStrc* pRoom, int32_t bCreate)
    conventionunknown→__fastcall