ClickToMove questions? menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ClickToMove questions?

    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?
    Last edited by Viano; 02-13-2010 at 12:30 PM.
    Viano

    ClickToMove questions?
  2. #2
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just forget my post, I used wrong offset.
    Viano

  3. #3
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When marshaling structs, it's generally good practice to not use properties for the marshaled fields, and give an explicit struct layout.

    Granted; these aren't really 'requirements', but it's better to be in the habit of doing these things, since the Marshaler has some pretty undocumented behaviors when you don't tell it exactly what you want it to do.

    Code:
    [StructLayout(LayoutKind.Sequential)]
    struct WoWPos
    {
    public float X;
    public float Y;
    public float Z;
    }

Similar Threads

  1. Model Changing Question
    By MasterYuke in forum World of Warcraft General
    Replies: 6
    Last Post: 09-17-2006, 09:56 PM
  2. Couple Private Server questions
    By Jboz in forum World of Warcraft General
    Replies: 21
    Last Post: 07-26-2006, 07:37 PM
  3. Sorry..newb mail question
    By nolbishop in forum World of Warcraft General
    Replies: 2
    Last Post: 06-07-2006, 07:21 PM
  4. Question..
    By janzi9 in forum Community Chat
    Replies: 3
    Last Post: 04-02-2006, 10:20 AM
  5. A GALB question
    By bassman in forum World of Warcraft General
    Replies: 4
    Last Post: 03-28-2006, 09:49 AM
All times are GMT -5. The time now is 12:03 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search