Recover the Mac skill-selected weapon result as the actual unit object
Ghidra vmac 111 · 3cfe190
Mac 0x00191c27 currently returns int*. Native source and consumer evidence identify D2UnitStrc*: every normal result is NULL or an unchanged item-unit pointer loaded from inventory cells, including the equipped-weapon output. The writer guards numeric UNIT_ITEM4 and stores the original unit start; both getters load that exact cell value. The output slot is definitely assigned under the target's actual nonnull Inventory guard. Exhaustive return-tag propagation retains both CMOV alternatives and excludes the temporary skill/scalar/owner-unit values. All15 actual callers and three physical dispatch tables are closed; two native consumers use the result as Unit type/class headers. Recover only D2UnitStrc* GetWeaponBySkill, preserving both selected inputs/names/Stack4+8/__cdecl and the EAX4 pointer interface. No helper/pending metadata premise, shared layout, input/model change, safety, execution, original Mac-file hash or build-gain claim.
Changes 1, applied together
Set prototype
mac 0x00191c27signatureint * GetWeaponBySkill(D2UnitStrc * pUnit, int32_t nParam)→D2UnitStrc * GetWeaponBySkill(D2UnitStrc * pUnit, int32_t nParam)convention__cdecl