Type and name TEXT_SetNpcMenuSelection's unit parameter
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
Retype variable
win 0x0049da30 ECXtypeint32_t→D2UnitStrc *Rename variable
win 0x0049da30 ECXnamenParam→pUnit