Definition at line 1533 of file WorldFile.cs.
1534 {
1535 short num = 0;
1536 for (
int i = 0;
i < 8000;
i++)
1537 {
1538 Chest chest = Main.chest[
i];
1539 if (chest == null)
1540 {
1541 continue;
1542 }
1543 bool flag = false;
1544 for (
int j = chest.x;
j <= chest.x + 1;
j++)
1545 {
1546 for (
int k = chest.y;
k <= chest.y + 1;
k++)
1547 {
1548 if (
j < 0 ||
k < 0 || j >= Main.maxTilesX ||
k >= Main.maxTilesY)
1549 {
1550 flag = true;
1551 break;
1552 }
1553 Tile tile = Main.tile[
j,
k];
1554 if (!tile.active() || !Main.tileContainer[tile.type])
1555 {
1556 flag = true;
1557 break;
1558 }
1559 }
1560 }
1561 if (flag)
1562 {
1563 Main.chest[
i] =
null;
1564 }
1565 else
1566 {
1567 num++;
1568 }
1569 }
1572 for (
int i = 0;
i < 8000;
i++)
1573 {
1574 Chest chest = Main.chest[
i];
1575 if (chest == null)
1576 {
1577 continue;
1578 }
1581 writer.Write(chest.name);
1582 for (
int l = 0;
l < 40;
l++)
1583 {
1586 {
1588 continue;
1589 }
1591 {
1592 item.stack = 1;
1593 }
1596 {
1599 }
1600 }
1601 }
1602 return (
int)
writer.BaseStream.Position;
1603 }
static bool[] ItemsThatShouldNotBeInInventory
References Terraria.Tile.active(), Terraria.Main.chest, System.item, Terraria.Chest.item, Terraria.ID.ItemID.Sets.ItemsThatShouldNotBeInInventory, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Chest.name, Terraria.Main.tile, Terraria.Main.tileContainer, Terraria.Tile.type, System.writer, Terraria.Chest.x, and Terraria.Chest.y.
Referenced by Terraria.IO.WorldFile.SaveWorld_Version2().