REDIVIVUS

Proposals / #681

Mac: companions to Windows #641 and #560 (SKILLASS_CreateSummon skills.txt row, SUNITNPC_DeductGoldForPurchase player)

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 body semantics. SKILLASS_CreateSummon: nParam1 is a D2SkillsTxt row (reads +0xbe pettype, +0xc0 petmax, +5 flag byte) and nParam2 is the skill level passed to D2GetSkillCalc and the summon helpers. SUNITNPC_DeductGoldForPurchase: pPlayerRaw is the player unit (reads its +0xc nUnitGUID to match the NPC's per-player inventory node and forwards it to SUNITNPC_RefreshNpcItem as the unit). Mac D2SkillsTxt has the same layout. Generic nParam1/nParam2 renamed as in #641; chosen name pPlayerRaw kept. Mac callers were not individually traced.

Changes 4, applied together

  1. Retype variable mac 0x0024b1d6 Stack[0x14]

    typeint32_t→D2SkillsTxt *
  2. Rename variable mac 0x0024b1d6 Stack[0x14]

    namenParam1→pSkillsTxt
  3. Rename variable mac 0x0024b1d6 Stack[0x1c]

    namenParam2→nSkillLvl
  4. Retype variable mac 0x002872d7 Stack[0x10]

    typeint32_t→D2UnitStrc *