Terraria.Chest.DestroyChestDirect C# (CSharp) Method

DestroyChestDirect() public static method

public static DestroyChestDirect ( int X, int Y, int id ) : void
X int
Y int
id int
return void
        public static void DestroyChestDirect(int X, int Y, int id)
        {
            if (id < 0)
                return;
            if (id >= Main.chest.Length)
                return;
            try
            {
                Chest chest = Main.chest[id];
                if (chest == null || chest.x != X || chest.y != Y)
                    return;
                Main.chest[id] = null;
                if (Main.player[Main.myPlayer].chest != id)
                    return;
                Main.player[Main.myPlayer].chest = -1;
            }
            catch
            {
            }
        }