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

◆ Check4x3Wall()

static void Terraria.WorldGen.Check4x3Wall ( int x,
int y )
inlinestatic

Definition at line 35970 of file WorldGen.cs.

35971 {
35972 if (destroyObject)
35973 {
35974 return;
35975 }
35976 bool flag = false;
35977 int type = Main.tile[x, y].type;
35978 int num = 0;
35979 int num2 = Main.tile[x, y].frameY / 18;
35980 while (num2 >= 3)
35981 {
35982 num2 -= 3;
35983 num++;
35984 }
35985 int num3 = y - num2;
35986 int num4 = x - Main.tile[x, y].frameX / 18;
35987 num2 = num * 54;
35988 for (int i = num4; i < num4 + 4; i++)
35989 {
35990 for (int j = num3; j < num3 + 3; j++)
35991 {
35992 if (Main.tile[i, j].type != type || !Main.tile[i, j].active() || Main.tile[i, j].wall <= 0 || Main.tile[i, j].frameY != num2 + (j - num3) * 18 || Main.tile[i, j].frameX != (i - num4) * 18)
35993 {
35994 flag = true;
35995 break;
35996 }
35997 }
35998 }
35999 if (!flag)
36000 {
36001 return;
36002 }
36003 destroyObject = true;
36004 for (int k = num4; k < num4 + 4; k++)
36005 {
36006 for (int l = num3; l < num3 + 3; l++)
36007 {
36008 if (Main.tile[k, l].type == type && Main.tile[k, l].active())
36009 {
36010 KillTile(k, l);
36011 }
36012 }
36013 }
36014 if (type == 241)
36015 {
36016 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 1417);
36017 }
36018 destroyObject = false;
36019 }
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

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