Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Check5x4()

static void Terraria.WorldGen.Check5x4 ( int i,
int j,
int type )
inlinestatic

Definition at line 41566 of file WorldGen.cs.

41567 {
41568 if (destroyObject)
41569 {
41570 return;
41571 }
41572 bool flag = false;
41573 int num = i;
41574 int num2 = j;
41575 int num3 = 0;
41576 int num4;
41577 for (num4 = Main.tile[i, j].frameX / 18; num4 >= 5; num4 -= 5)
41578 {
41579 num3++;
41580 }
41581 num -= num4;
41582 num2 += Main.tile[i, j].frameY / 18 * -1;
41583 for (int k = num; k < num + 5; k++)
41584 {
41585 for (int l = num2; l < num2 + 4; l++)
41586 {
41587 if (Main.tile[k, l] == null)
41588 {
41589 Main.tile[k, l] = new Tile();
41590 }
41591 if (!Main.tile[k, l].active() || Main.tile[k, l].type != type || Main.tile[k, l].frameX != num3 * 90 + (k - num) * 18 || Main.tile[k, l].frameY != (l - num2) * 18)
41592 {
41593 flag = true;
41594 }
41595 }
41596 if (Main.tile[k, num2 + 4] == null)
41597 {
41598 Main.tile[k, num2 + 4] = new Tile();
41599 }
41600 if (!SolidTileAllowBottomSlope(k, num2 + 4))
41601 {
41602 flag = true;
41603 }
41604 }
41605 if (!flag)
41606 {
41607 return;
41608 }
41609 destroyObject = true;
41610 for (int m = num; m < num + 5; m++)
41611 {
41612 for (int n = num2; n < num2 + 4; n++)
41613 {
41614 if (Main.tile[m, n].type == type && Main.tile[m, n].active())
41615 {
41616 KillTile(m, n);
41617 }
41618 }
41619 }
41620 if (type == 464)
41621 {
41622 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 3814);
41623 }
41624 if (type == 466)
41625 {
41626 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 3816);
41627 }
41628 destroyObject = false;
41629 for (int num5 = num - 1; num5 < num + 6; num5++)
41630 {
41631 for (int num6 = num2 - 1; num6 < num2 + 5; num6++)
41632 {
41634 }
41635 }
41636 }
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool SolidTileAllowBottomSlope(int i, int j)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.Item.NewItem(), Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.