Hi, I have a strange error when RegisterDelegate
Code:
_castSpell = maga.RegisterDelegate<CastSpellDelegate>((uint)Process.GetCurrentProcess().MainModule.BaseAddress + CastSpellPtr);
I'm just trying to get a callback when someone casts a spell
Code:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool CastSpellDelegate(int spellId, int unk, ulong targetGuid, int unk1, int unk2);
private static CastSpellDelegate _castSpell;
Code:
public static void CastSpell(int spellId, ulong target)
{
Console.WriteLine(1);
}
I just started to understand the callbacks, tell me the right direction)