Always returns 0, except (a2 == this).
I tried different return types (byte, int, bool, char ).
Code:
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
public delegate int IsInMyPartyOrRaidDelegate(uint u1, uint u2);
public static IsInMyPartyOrRaidDelegate IsInMyPartyOrRaid;
Code:
char __thiscall CGUnit_C__IsInMyPartyOrRaid(int this, int a2)
{
char result; // al@2
int v3; // eax@5
int v4; // edi@5
int v5; // esi@5
int v6; // eax@8
int v7; // esi@10
int v8; // [sp+4h] [bp-8h]@8
int v9; // [sp+8h] [bp-4h]@8
if ( a2 == this )
{
result = 1;
}
else
{
if ( (*(_DWORD *)(*(_DWORD *)(this + 208) + 212) >> 3) & 1 && (*(_DWORD *)(*(_DWORD *)(a2 + 208) + 212) >> 3) & 1 )
{
v5 = CGUnit_C__GetControllingPlayer(this);
v3 = CGUnit_C__GetControllingPlayer(a2);
v4 = v3;
result = v5
&& v3
&& ((unsigned __int8)CGObject_C__IsLocalPlayer(v5)
&& (v6 = *(_DWORD *)(v4 + 8), v8 = *(_DWORD *)v6, v9 = *(_DWORD *)(v6 + 4), sub_5129F0(&v8))
|| (unsigned __int8)CGObject_C__IsLocalPlayer(v4)
&& (v7 = *(_DWORD *)(v5 + 8), v8 = *(_DWORD *)v7, v9 = *(_DWORD *)(v7 + 4), sub_5129F0(&v8)));
}
else
{
result = 0;
}
}
return result;
}
However CanAttack works fine.
char __thiscall CGUnit_C__CanAttack(int this, int a2)