Mac MONSTERAI_ValidateSwitchTarget: BOOL __fastcc (pUnit, ppUnit, pDistance, nTmp, nDistance)
Mac 0x001a66c0 is "undefined (void)", convention unknown. Entry: EBX=ECX (unit; [EBX]==0 player check, its pPath used), EDX = in/out unit slot (MOV EAX,[EDX], later *EDX = best unit), stack [EBP+8] = out distance pointer, [EBP+0xc] = gate (TEST, zero => return 0), [EBP+0x10] = distance (<6 triggers the path probe); returns 0/1 in EAX; plain RET. Both callers in MONSTERAI_FindBestTarget load ECX=unit, EDX=LEA of a local unit slot, store [ESP]=LEA of a local distance, [ESP+4], [ESP+8], then TEST EAX,EAX (0x001a5fa3-0x001a5fbe, 0x001a631a-0x001a6335). Windows twin 0x005dd510 has the same five values: BOOL (D2UnitStrc** ppUnit, int* pDistance, int32_t nParam1, int32_t nParam2, D2UnitStrc* pUnit). The gate argument keeps a fallback name.
Changes 1, applied together
Set prototype
mac 0x001a66c0signatureundefined MONSTERAI_ValidateSwitchTarget(void)→BOOL MONSTERAI_ValidateSwitchTarget(D2UnitStrc * pUnit, D2UnitStrc * * ppUnit, int * pDistance, int32_t nTmp, int32_t nDistance)conventionunknown→__fastcc