REDIVIVUS

Proposals / #662

Retype SKILLS_GetTargetTypeForSkill's two unit parameters to D2UnitStrc *

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

Ghidra v1798 · d52cd0a

Both register parameters are units: the body reads +0xc (D2UnitStrc.nUnitGUID) of each and tests *pnParam == 1 (eUnitType == UNIT_MONSTER) before resolving the roster owner. The only caller, SKILL_ValidateTarget(D2UnitStrc * pUnit, D2UnitStrc * pUnit2, ...), passes EDI (entry ECX = pUnit, written at 0x004c596d) and ESI (entry EDX = pUnit2, 0x004c5969). Same-width retypes; the generic nParam is renamed pUnit and the chosen name pnParam is kept.

Changes 3, applied together

  1. Retype variable win 0x004c5910 ECX

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

    namenParam→pUnit
  3. Retype variable win 0x004c5910 EDX

    typeint *→D2UnitStrc *