REDIVIVUS

Proposals / #1698

Recover the Mac equipment-light helper's unit/byte API and scalar code local

checked · by eejitgames · submitted 2026-11-08

Mac 0017d404 is undefined(void)/unknown although native code reads a unit from Stack4 and returns the unsigned maximum of 16 item light-radius bytes. Both known callers consume AL; matched Windows 0063ebd0 returns uint8_t with AL-only exits. Restore uint8_t cdecl(D2UnitStrc*) on Mac. Type the component cursor as byte* and its packed overlay-code local as uint32_t: native code walks Components[0..15] at monster-data+4 and compares DWORD codes with literal item codes before lookup. Preserve chosen names, outputs and behavior.

Changes 4, applied together

  1. Set prototype mac 0x0017d404

    signatureundefined MONSTERS_GetMaxLightRadiusFromEquipment(void)→uint8_t MONSTERS_GetMaxLightRadiusFromEquipment(D2UnitStrc * pUnit)
    conventionunknown→__cdecl
  2. Retype variable mac 0x0017d404 EAX

    typeD2UnitStrc *→uint32_t
  3. Retype variable mac 0x0017d404 Stack[-0x18]

    typeundefined4→byte *
  4. Rename variable mac 0x0017d404 Stack[-0x18]

    namelocal_18→pComponents