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

◆ Place2x1()

static void Terraria.WorldGen.Place2x1 ( int x,
int y,
ushort type,
int style = 0 )
inlinestatic

Definition at line 38497 of file WorldGen.cs.

38498 {
38499 if (Main.tile[x, y] == null)
38500 {
38501 Main.tile[x, y] = new Tile();
38502 }
38503 if (Main.tile[x + 1, y] == null)
38504 {
38505 Main.tile[x + 1, y] = new Tile();
38506 }
38507 if (Main.tile[x, y + 1] == null)
38508 {
38509 Main.tile[x, y + 1] = new Tile();
38510 }
38511 if (Main.tile[x + 1, y + 1] == null)
38512 {
38513 Main.tile[x + 1, y + 1] = new Tile();
38514 }
38515 bool flag = false;
38516 if (type != 29 && type != 103 && SolidTile2(x, y + 1) && SolidTile2(x + 1, y + 1) && !Main.tile[x, y].active() && !Main.tile[x + 1, y].active())
38517 {
38518 flag = true;
38519 }
38520 else if ((type == 29 || type == 103) && Main.tile[x, y + 1].active() && Main.tile[x + 1, y + 1].active() && Main.tileTable[Main.tile[x, y + 1].type] && Main.tileTable[Main.tile[x + 1, y + 1].type] && !Main.tile[x, y].active() && !Main.tile[x + 1, y].active())
38521 {
38522 flag = true;
38523 }
38524 if (flag)
38525 {
38526 Main.tile[x, y].active(active: true);
38527 Main.tile[x, y].frameY = 0;
38528 Main.tile[x, y].frameX = (short)(36 * style);
38529 Main.tile[x, y].type = type;
38530 Main.tile[x + 1, y].active(active: true);
38531 Main.tile[x + 1, y].frameY = 0;
38532 Main.tile[x + 1, y].frameX = (short)(36 * style + 18);
38533 Main.tile[x + 1, y].type = type;
38534 }
38535 }
static bool SolidTile2(Tile testTile)

References Terraria.DataStructures.Tile, Terraria.Main.tile, Terraria.Main.tileTable, and System.type.