REDIVIVUS

Proposals / #812

Mac: companions to applied Windows retypes (client, unit and items.txt parameters), retype only

applied · by Captain-Fwiffo · submitted 2026-11-02, applied 2026-11-02

Ghidra vmac 110 · 9528519

Reworked resubmission of #425, #426 and #459 after review. Dropped: the two DAMAGE_RemoveDamageListEntry ops (already in #293) and CLIENT_RemoveFromAdjacentRooms (reviewer wants a dereference proof). Kept, now that the Windows twins are applied (#414, #417, #421, #458): NpcStateIsntZero; DRLGROOM_Add/RemoveClientFromRoom (stored into / compared with pRoom->pClients); Q32_CheckWussieBarricade, Q32_FindBarricadePortal and Q32_IncrementWussieKillCount (the value is passed to Q32_FindBarricadeGroup as a unit; generic nParam renamed pUnit); TEXT_OpenQuestScroll (unit read at +0xc; Stack[0x8] compared at +0x80 with 'bkd ' = D2ItemsTxt.dwCode); SUNITPROXY_SendProxyItemsToClient (Stack[0xc] cast to D2UnitStrc * for GetPlayerProxyInventory). Renames of chosen names are refused by the checker and requested in a separate GitHub issue. __cdecl, plain stack slots; Mac decompiles only.

Changes 11, applied together

  1. Retype variable mac 0x001d93ef Stack[0x8]

    typeint32_t→D2UnitStrc *
  2. Retype variable mac 0x00165df9 Stack[0x8]

    typeint32_t→D2ClientStrc *
  3. Retype variable mac 0x00165fb1 Stack[0x8]

    typeint32_t→D2ClientStrc *
  4. Retype variable mac 0x0023c1f1 Stack[0x8]

    typeint32_t→D2UnitStrc *
  5. Rename variable mac 0x0023c1f1 Stack[0x8]

    namenParam→pUnit
  6. Retype variable mac 0x0023caf7 Stack[0x8]

    typeint32_t→D2UnitStrc *
  7. Rename variable mac 0x0023caf7 Stack[0x8]

    namenParam→pUnit
  8. Retype variable mac 0x0023c246 Stack[0xc]

    typeint32_t→D2UnitStrc *
  9. Retype variable mac 0x000f35f7 Stack[0x4]

    typeint32_t→D2UnitStrc *
  10. Retype variable mac 0x000f35f7 Stack[0x8]

    typeint32_t→D2ItemsTxt *
  11. Retype variable mac 0x0028c9b3 Stack[0xc]

    typeint32_t→D2UnitStrc *