REDIVIVUS

Proposals / #972

Type the Mac interacted-NPC getter result as a unit pointer

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

Ghidra vmac 111 · 3cfe190

The Mac getter declares undefined yet returns fullEAX null or the actual matching D2UnitStrc* node. It passes current GUID and literal UNIT_MONSTER1 into the existing typed lookup facade; complete native node walk independently validates GUID/type and follows unit.pListNext, so no pending/undefined helper prototype is a premise. Sole inventory caller copies the entire result, null-guards and reads common unit.nClassId+4. Resolve only return to existing D2UnitStrc*, preserving chosen name, zero formals, locals and unknown convention; this is not ABI recovery. Full4Mac code bodies10453bytes match separate assembly, including all2164caller instructions in6bounded slices;36switch bytes close9physical entries plus separate default. Every return/actual internal argument route is checked. No unit-union/hash-table/global/type/name/caller edits, Windows/runtime/build claim or reduced held-family refile.

Changes 1, applied together

  1. Set prototype mac 0x000c525c

    signatureundefined INV_GetInteractedNpcUnit(void)→D2UnitStrc * INV_GetInteractedNpcUnit(void)
    conventionunknown