Terraria.Player.QuickMount C# (CSharp) Method

QuickMount() public method

public QuickMount ( ) : void
return void
        public void QuickMount()
        {
            if (this.mount.Active)
            {
                this.mount.Dismount(this);
            }
            else
            {
                if (this.frozen || this.tongued || (this.webbed || this.stoned) || ((double)this.gravDir == -1.0 || this.noItems))
                    return;
                Item obj = (Item)null;
                if (obj == null && this.miscEquips[3].mountType != -1 && !MountID.Sets.Cart[this.miscEquips[3].mountType])
                    obj = this.miscEquips[3];
                if (obj == null)
                {
                    for (int index = 0; index < 58; ++index)
                    {
                        if (this.inventory[index].mountType != -1 && !MountID.Sets.Cart[this.inventory[index].mountType])
                        {
                            obj = this.inventory[index];
                            break;
                        }
                    }
                }
                if (obj == null || obj.mountType == -1 || !this.mount.CanMount(obj.mountType, this))
                    return;
                this.mount.SetMount(obj.mountType, this, false);
                if (obj.useSound <= 0)
                    return;
                Main.PlaySound(2, (int)this.Center.X, (int)this.Center.Y, obj.useSound);
            }
        }
Player