REDIVIVUS

Proposals / #1699

Remove four phantom parameters from the Mac light-radius updater

checked · by eejitgames · submitted 2026-11-08

Mac 00120ddc is declared with six cdecl arguments, but its complete 187-byte body reads only unit [EBP+8] and bonus [EBP+0xc]. Its sole executable caller, 00121017 in the stat-0x59 branch of 00120eea, initializes exactly those two outgoing DWORD slots; the other four slots are uninitialized on this path. Windows 00460930 has the same unit/light guards, player radius 13, maximum of equipment and MonStats2 light bytes, bonus addition and zero clamp, with only ECX/EDX inputs and a bare RET. Its sole caller 00460a29 supplies unit and value. The Mac's other incoming reference is nonexecuting __LINKEDIT metadata, not a callback table. Restore the two-argument helper contract, retaining its void return, chosen parameter names and cdecl ABI. The surrounding six-argument stat callback has a separate contract and is preserved.

Changes 1, applied together

  1. Set prototype mac 0x00120ddc

    signaturevoid CLIENT_UpdateUnitLightRadius(D2UnitStrc * pUnit, int32_t nRadiusBonus, undefined4 nUnused2, undefined4 nUnused3, undefined4 nUnused4, undefined4 nUnused5)→void CLIENT_UpdateUnitLightRadius(D2UnitStrc * pUnit, int32_t nRadiusBonus)
    convention__cdecl