What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

CommonTasks.MountUp exiting early

iyake

Member
Joined
Oct 19, 2014
Messages
143
CommonTasks.MountUp is exiting early I think.

I don't really have a way to post a log, but something like

Code:
await CommonTasks.MountUp(1);

MovementManager.MoveForwardStart();

will start casting the chocobo mount but also immediately start moving forward and canceling the mount cast.
 
CommonTasks.MountUp is exiting early I think.

I don't really have a way to post a log, but something like

Code:
await CommonTasks.MountUp(1);

MovementManager.MoveForwardStart();

will start casting the chocobo mount but also immediately start moving forward and canceling the mount cast.

Are you using it within a coroutine properly? It'll behave like that if your not calling it from within an async block.

Can you post the entire chunk your using?
 
Compiler wouldn't let you await outside of an async block, but here's the method that I was running into the problem:

Code:
        public async Task<bool> Fly() {
            bool moving = false;

            // can't mount continue on tree
            if (Core.Me.InCombat && !Core.Me.IsMounted) return false;

            await CommonTasks.MountUp(Convert.ToUInt32(MountId));

            MovementManager.SetFacing2D(Location);

            await CommonTasks.TakeOff();

            if (Altitude > float.MinValue) {
                if (Core.Me.Location.Y > Altitude + 1f) {
                    await CommonTasks.DescendTo(Altitude);
                } else if (Core.Me.Location.Y < Altitude - 1f) {
                    await CommonTasks.AscendTo(Altitude);
                }
            }

            while (Core.Me.Location.Distance2D(Location) > Radius) {
                if (!moving) {
                    MovementManager.MoveForwardStart();
                    moving = true;
                }
                MovementManager.SetFacing2D(Location);
                await Coroutine.Yield();
            }

            MovementManager.MoveForwardStop();

            if (LandAfter)
                await CommonTasks.Land();

            _done = true;
            return true;
        }

replacing it with a custom mount method:

Code:
        public static async Task<bool> Mount(int MountId) {
            if (MountId == 0) return true;

            if (!Core.Player.IsMounted) {
                Actionmanager.Mount(Convert.ToUInt32(MountId));
                await Coroutine.Wait(3000, () => Core.Me.IsMounted);
            }

            return true;
        }

worked
 
Yea you should leave the mounting up logic to take off as it checks to make sure you can fly with the chocobo and if not it dismounts and dismisses the companion if present and gets on the black chocobo. Also, you should be checking the return value of takeoff as you are currently assuming that it always succeeds which is not the case.
 
I was able to replicate the issue. Looks like I inverted an if on accident. Pushing a new build now.
 
Back
Top