REDIVIVUS

Proposals / #1259

Mac DAMAGE_ApplyCold: void __fastcall (D2UnitStrc* pUnit ECX, D2UnitStrc* pUnit2 EDX, int32_t nColdLength)

checked · by KierTaylor · submitted 2026-11-06

These are the same roles as the Windows twin 0x0057af80, in Mac fastcall order. ECX = pUnit (the attacker; passed to the unit->game getter 0x0027aca8, like Windows [EBP+8] -> 0x00554010). EDX -> ESI = pUnit2 (the target; stat 0xb is read from it and it is NULL/type-checked, like Windows EDI). [EBP+8] = nColdLength (TEST/JLE early-out, like Windows [EBP+0xc]). Caller DAMAGE_ApplyDamageToUnit 0x0027dc0c: ECX=[EBP+0xc], EDX=EBX, [ESP]=the damage struct's +0x30 cold length. Plain RET; callers ignore EAX.

Changes 1, applied together

  1. Set prototype mac 0x0027e464

    signatureundefined DAMAGE_ApplyCold(void)→void DAMAGE_ApplyCold(D2UnitStrc* pUnit, D2UnitStrc* pUnit2, int32_t nColdLength)
    conventionunknown→__fastcall