Hi there,
Apoc posted the signature of click to move in one of his posts.
Code:
BOOL __thiscall CGPlayer_C__ClickToMove(WoWActivePlayer *this, CLICKTOMOVETYPE clickType, WGUID *interactGuid, WOWPOS *clickPos, float precision)
In C# I would replace WoWActivePlayer with IntPtr, CLICKTOMOVETYPE with uint, WGUID with ulong but what the heck is WOWPOS? A struct like the following?
Code:
public struct WOWPOS
{
public float x {get; set;}
public float y { get; set; }
public float z { get; set; }
}
So the C# definition should look like this. Right?
Code:
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
private delegate byte ClickToMoveDelegate(IntPtr pointer, int clickType, ref ulong guid, ref Pos clickPos, float precision);
So why can't I call it like this without WoW crashing?
Code:
WOWPOS p = new WOWPOS();
p.x = position.X;
p.y = position.Y;
p.z = position.Z;
ulong guid = 0;
ClickToMove(ObjectManager.Instance.Player.Pointer, 0x4, ref guid, ref p, 0);
If I am just moving my player do I have to use his GUID or just set it to 0 like above?