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

◆ CheckDoorClosed()

static void Terraria.WorldGen.CheckDoorClosed ( int i,
int j,
Tile tileCache,
int type )
inlinestaticprivate

Definition at line 76500 of file WorldGen.cs.

76501 {
76502 if (!destroyObject)
76503 {
76504 int num = j;
76505 bool flag = false;
76506 int frameY = tileCache.frameY;
76507 int num2 = frameY / 54;
76508 num2 += tileCache.frameX / 54 * 36;
76509 num = j - frameY % 54 / 18;
76510 Tile tile = Main.tile[i, num - 1];
76511 Tile tile2 = Main.tile[i, num];
76512 Tile tile3 = Main.tile[i, num + 1];
76513 Tile tile4 = Main.tile[i, num + 2];
76514 Tile tile5 = Main.tile[i, num + 3];
76515 if (tile == null)
76516 {
76517 tile = new Tile();
76518 Main.tile[i, num - 1] = tile;
76519 }
76520 if (tile2 == null)
76521 {
76522 tile2 = new Tile();
76523 Main.tile[i, num] = tile2;
76524 }
76525 if (tile3 == null)
76526 {
76527 tile3 = new Tile();
76528 Main.tile[i, num + 1] = tile3;
76529 }
76530 if (tile4 == null)
76531 {
76532 tile4 = new Tile();
76533 Main.tile[i, num + 2] = tile4;
76534 }
76535 if (tile5 == null)
76536 {
76537 tile5 = new Tile();
76538 Main.tile[i, num + 3] = tile5;
76539 }
76540 if (!SolidTile(tile))
76541 {
76542 flag = true;
76543 }
76544 if (!SolidTile(tile5))
76545 {
76546 flag = true;
76547 }
76548 if (!tile2.active() || tile2.type != type)
76549 {
76550 flag = true;
76551 }
76552 if (!tile3.active() || tile3.type != type)
76553 {
76554 flag = true;
76555 }
76556 if (!tile4.active() || tile4.type != type)
76557 {
76558 flag = true;
76559 }
76560 if (flag)
76561 {
76562 destroyObject = true;
76563 KillTile(i, num);
76564 KillTile(i, num + 1);
76565 KillTile(i, num + 2);
76566 DropDoorItem(i, j, num2);
76567 }
76568 destroyObject = false;
76569 }
76570 }
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 DropDoorItem(int x, int y, int doorStyle)

References Terraria.Tile.frameY, Terraria.Enums.SolidTile, Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.