REDIVIVUS

Proposals / #669

Mac: companions to the Windows #640, #662 and #530 retypes (unit/game parameters)

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

Ghidra vmac 106 · d52cd0a

Mac twins of already-proposed Windows fixes, with the same defect and identical body semantics: SKILLS_FindUnitsInRange / SKILLS_FreeUnitFindData load +0x1c (D2GameStrc.pMemoryPool) from their game parameter; SKILLS_ApplyDamageReduction scales the +0x44 unit field (nGfxCurrentFrame); SKILLS_GetTargetTypeForSkill reads +0xc (nUnitGUID) of both parameters and tests *pnParam == 1 (UNIT_MONSTER). Types follow the Mac database (D2GameStrc in place of SGAMEDATA); generic nParam / nParam1 renamed pUnit / pGame like the Windows proposals, chosen names kept. Mac callers were not individually traced; the retypes follow from how each body uses its parameter.

Changes 7, applied together

  1. Retype variable mac 0x00269522 Stack[0x4]

    typeint32_t→D2GameStrc *
  2. Rename variable mac 0x00269522 Stack[0x4]

    namenParam1→pGame
  3. Retype variable mac 0x002695e3 Stack[0x4]

    typeint32_t→D2GameStrc *
  4. Retype variable mac 0x00083dca Stack[0x4]

    typeint32_t→D2UnitStrc *
  5. Retype variable mac 0x0008147a Stack[0x4]

    typeint32_t→D2UnitStrc *
  6. Rename variable mac 0x0008147a Stack[0x4]

    namenParam→pUnit
  7. Retype variable mac 0x0008147a Stack[0x8]

    typeint *→D2UnitStrc *