REDIVIVUS

Proposals / #1247

Mac SKILLNEC_AssignCurseAiBehavior: void __cdecl (pGame, dwUnused, pUnit, nSkillId)

checked · by KierTaylor · submitted 2026-11-06

The Mac body reads [EBP+8] (pGame, passed to AttachCorrectAiFunctionToMonster), [EBP+0x10] (pUnit, checked for type 1 and pUnitData->pAiGeneral at +0x14/+0x28) and [EBP+0x14] (nSkillId, bounds-checked against sgptDataTable skill count, then auratargetstate 0x17/0x1b/0x38 maps to 10/12/11). [EBP+0xc] is never read, and the only caller (SKILLNEC_ApplyCurseToUnit 0x00262ebd) leaves [ESP+4] unset while storing [ESP], [ESP+8] and [ESP+0xc]. Plain RET. Same logic as the Windows twin 0x005c34b0. The Mac arg order differs, so the slot is kept as dwUnused.

Changes 1, applied together

  1. Set prototype mac 0x00262c64

    signatureundefined SKILLNEC_AssignCurseAiBehavior(void)→void SKILLNEC_AssignCurseAiBehavior(D2GameStrc* pGame, uint32_t dwUnused, D2UnitStrc* pUnit, int32_t nSkillId)
    conventionunknown→__cdecl