Terraria.Player.ChangeDir C# (CSharp) Method

ChangeDir() public method

public ChangeDir ( int dir ) : void
dir int
return void
        public void ChangeDir(int dir)
        {
            if (!this.pulley || (int)this.pulleyDir != 2)
            {
                this.direction = dir;
            }
            else
            {
                if ((int)this.pulleyDir == 2 && dir == this.direction)
                    return;
                int num = (int)((double)this.position.X + (double)(this.width / 2)) / 16 * 16 + 8 - this.width / 2;
                if (Collision.SolidCollision(new Vector2((float)num, this.position.Y), this.width, this.height))
                    return;
                if (this.whoAmI == Main.myPlayer)
                    Main.cameraX = Main.cameraX + this.position.X - (float)num;
                this.pulleyDir = (byte)1;
                this.position.X = (float)num;
                this.direction = dir;
            }
        }
Player