REDIVIVUS

Proposals / #1006

Recover the full Mac equip-swap argument and action-code contract

applied · by Commit-Will · submitted 2026-11-02, applied 2026-11-02

Ghidra vmac 111 · 3cfe190

Mac0016a093 has five actual inputs: ECX owner Unit, EDX opposite body slot, then new/current/other item pointers in three caller-owned DWORD stack slots. The sole caller proves every source and computes slot4↔5 or11↔12, matching existing four-byte eD2BodyLocDWORD. All normal returns construct only action codes0..7. Recover the complete uint32_t __fastcc prototype; preserve function/locals and use existing precise types. A fresh same-model five-argument native precedent plus clean decompiles verifies caller-owned stack behavior. Windows's different custom input arrangement remains read-only. No guessed control flag, enum widening, record/layout, shared model or behavior change.

Changes 1, applied together

  1. Set prototype mac 0x0016a093

    signatureundefined INVENTORY_GetEquipSwapAction(void)→uint32_t INVENTORY_GetEquipSwapAction(D2UnitStrc * pUnit, eD2BodyLocDWORD eOtherBodyLoc, D2UnitStrc * pNewItem, D2UnitStrc * pCurrentItem, D2UnitStrc * pOtherItem)
    conventionunknown→__fastcc