REDIVIVUS

Proposals / #721

Type and name TEXT_SetNpcMenuSelection's unit parameter

applied · by Captain-Fwiffo · submitted 2026-11-01, applied 2026-11-02

Ghidra v1803 · bc4e150

The ECX parameter is a unit (or NULL to clear): after a null test the body copies its +0xc (D2UnitStrc.nUnitGUID) into gnTextNpcMenuIndex. Its two callers pass a unit or null: SetSelectedUnit_I(D2UnitStrc * pUnit) passes ESI (copy of its entry EAX, MOV ESI,EAX at 0x00466df1; ECX=ESI at 0x00466e0b), and SELECT_HandleMouseInput passes ECX = 0 (XOR ECX,ECX at 0x0046715b) when no overhead speaker unit exists. Same-width retype; generic nParam renamed pUnit.

Changes 2, applied together

  1. Retype variable win 0x0049da30 ECX

    typeint32_t→D2UnitStrc *
  2. Rename variable win 0x0049da30 ECX

    namenParam→pUnit