Terraria.Player.WaterCollision C# (CSharp) Method

WaterCollision() public method

public WaterCollision ( bool fallThrough, bool ignorePlats ) : void
fallThrough bool
ignorePlats bool
return void
        public void WaterCollision(bool fallThrough, bool ignorePlats)
        {
            int Height = !this.onTrack ? this.height : this.height - 20;
            Vector2 vector2_1 = this.velocity;
            this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, Height, fallThrough, ignorePlats, (int)this.gravDir);
            Vector2 vector2_2 = this.velocity * 0.5f;
            if ((double)this.velocity.X != (double)vector2_1.X)
                vector2_2.X = this.velocity.X;
            if ((double)this.velocity.Y != (double)vector2_1.Y)
                vector2_2.Y = this.velocity.Y;
            Player player = this;
            Vector2 vector2_3 = player.position + vector2_2;
            player.position = vector2_3;
        }
Player