REDIVIVUS

Proposals / #1695

Restore the Mac weapon-GUID setter's unit-pointer and void API

checked · by eejitgames · submitted 2026-11-08

Mac 00192e8a stores pWeapon as int* and has an undefined result. Native code requires an item unit (type 4 at +0), copies its GUID at +0xc into playerData+0x90, or stores zero for a NULL weapon. Its complete 144-byte body matches Windows 006233a0, whose API is void(D2UnitStrc*,D2UnitStrc*), including assert lines 0x14c5/0x14c9. All four Mac calls pass an inventory weapon unit or NULL and discard the result. Restore pWeapon to D2UnitStrc* and return void in one prototype edit; preserve names, Mac cdecl and the exact field-update behavior.

Changes 1, applied together

  1. Set prototype mac 0x00192e8a

    signatureundefined UNITS_SetWeaponGUID(D2UnitStrc * pUnit, int * pWeapon)→void UNITS_SetWeaponGUID(D2UnitStrc * pUnit, D2UnitStrc * pWeapon)
    convention__cdecl