[Help] One Way Gates

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
Hey Devbest,
So the emulator I am using did not support one way gates, and I recoded most of the structure for them but I have a problem.

Now if I have it like this
Code:
if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y)) {
User.ClearMovement();
}
It will work if you click after the gate.. but when I changed it to this:
Code:
User.IsWalking = true;
User.GoalX = Item.SquareInFront.X;
User.GoalY = Item.SquareInFront.Y;
It won't work at all.

Code 1 -> You have to click the space through the gate ----- So if it is setup like this:
586417fec09549d29737ee601d322380.png

You can't get in. So my attempt with the 2nd gate so so that if you double click it, it will set the gate to the tile after it (SquareInFront) and let the user go through.

Code:
internal void ClearMovement()
        {
            IsWalking = false;
            GoalX = 0;
            GoalY = 0;
            SetStep = false;
            try
            {
                GetRoom().GetRoomUserManager().ToSet.Remove(new Point(SetX, SetY));
            }
            catch (Exception)
            {
            }
            SetX = 0;
            SetY = 0;
            SetZ = 0.0;

            if (!Statusses.ContainsKey("mv")) return;
            Statusses.Remove("mv");
            UpdateNeeded = true;
        }
Please help with this :( Spent 4 hours on this recoding these gates.

Thanks!
 

Users who are viewing this thread

Top