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

◆ Place4x2()

static void Terraria.WorldGen.Place4x2 ( int x,
int y,
ushort type,
int direction = -1,
int style = 0 )
inlinestatic

Definition at line 41906 of file WorldGen.cs.

41907 {
41908 if (x < 5 || x > Main.maxTilesX - 5 || y < 5 || y > Main.maxTilesY - 5)
41909 {
41910 return;
41911 }
41912 bool flag = true;
41913 for (int i = x - 1; i < x + 3; i++)
41914 {
41915 for (int j = y - 1; j < y + 1; j++)
41916 {
41917 if (Main.tile[i, j] == null)
41918 {
41919 Main.tile[i, j] = new Tile();
41920 }
41921 if (Main.tile[i, j].active())
41922 {
41923 flag = false;
41924 }
41925 }
41926 if (Main.tile[i, y + 1] == null)
41927 {
41928 Main.tile[i, y + 1] = new Tile();
41929 }
41930 if (!SolidTile2(i, y + 1))
41931 {
41932 flag = false;
41933 }
41934 }
41935 short num = 0;
41936 if (direction == 1)
41937 {
41938 num = 72;
41939 }
41940 int num2 = 36 * style;
41941 if (flag)
41942 {
41943 Main.tile[x - 1, y - 1].active(active: true);
41944 Main.tile[x - 1, y - 1].frameY = (short)num2;
41945 Main.tile[x - 1, y - 1].frameX = num;
41946 Main.tile[x - 1, y - 1].type = type;
41947 Main.tile[x, y - 1].active(active: true);
41948 Main.tile[x, y - 1].frameY = (short)num2;
41949 Main.tile[x, y - 1].frameX = (short)(18 + num);
41950 Main.tile[x, y - 1].type = type;
41951 Main.tile[x + 1, y - 1].active(active: true);
41952 Main.tile[x + 1, y - 1].frameY = (short)num2;
41953 Main.tile[x + 1, y - 1].frameX = (short)(36 + num);
41954 Main.tile[x + 1, y - 1].type = type;
41955 Main.tile[x + 2, y - 1].active(active: true);
41956 Main.tile[x + 2, y - 1].frameY = (short)num2;
41957 Main.tile[x + 2, y - 1].frameX = (short)(54 + num);
41958 Main.tile[x + 2, y - 1].type = type;
41959 Main.tile[x - 1, y].active(active: true);
41960 Main.tile[x - 1, y].frameY = (short)(num2 + 18);
41961 Main.tile[x - 1, y].frameX = num;
41962 Main.tile[x - 1, y].type = type;
41963 Main.tile[x, y].active(active: true);
41964 Main.tile[x, y].frameY = (short)(num2 + 18);
41965 Main.tile[x, y].frameX = (short)(18 + num);
41966 Main.tile[x, y].type = type;
41967 Main.tile[x + 1, y].active(active: true);
41968 Main.tile[x + 1, y].frameY = (short)(num2 + 18);
41969 Main.tile[x + 1, y].frameX = (short)(36 + num);
41970 Main.tile[x + 1, y].type = type;
41971 Main.tile[x + 2, y].active(active: true);
41972 Main.tile[x + 2, y].frameY = (short)(num2 + 18);
41973 Main.tile[x + 2, y].frameX = (short)(54 + num);
41974 Main.tile[x + 2, y].type = type;
41975 }
41976 }
static bool SolidTile2(Tile testTile)

References Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.