TModLoader v1.4.4.9
TModLoader 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 80153 of file WorldGen.cs.

80154 {
80155 if (destroyObject)
80156 {
80157 return;
80158 }
80159 int num = j;
80160 bool flag = false;
80161 int frameY = tileCache.frameY;
80162 int num2 = frameY / 54;
80163 num2 += tileCache.frameX / 54 * 36;
80164 num = j - frameY % 54 / 18;
80165 Tile tile = Main.tile[i, num - 1];
80166 Tile tile2 = Main.tile[i, num];
80167 Tile tile3 = Main.tile[i, num + 1];
80168 Tile tile4 = Main.tile[i, num + 2];
80169 Tile tile5 = Main.tile[i, num + 3];
80170 if (tile == null)
80171 {
80172 tile = (Main.tile[i, num - 1] = default(Tile));
80173 }
80174 if (tile2 == null)
80175 {
80176 tile2 = (Main.tile[i, num] = default(Tile));
80177 }
80178 if (tile3 == null)
80179 {
80180 tile3 = (Main.tile[i, num + 1] = default(Tile));
80181 }
80182 if (tile4 == null)
80183 {
80184 tile4 = (Main.tile[i, num + 2] = default(Tile));
80185 }
80186 if (tile5 == null)
80187 {
80188 tile5 = (Main.tile[i, num + 3] = default(Tile));
80189 }
80190 if (!SolidTile(tile))
80191 {
80192 flag = true;
80193 }
80194 if (!SolidTile(tile5))
80195 {
80196 flag = true;
80197 }
80198 if (!tile2.active() || tile2.type != type)
80199 {
80200 flag = true;
80201 }
80202 if (!tile3.active() || tile3.type != type)
80203 {
80204 flag = true;
80205 }
80206 if (!tile4.active() || tile4.type != type)
80207 {
80208 flag = true;
80209 }
80210 if (flag)
80211 {
80212 destroyObject = true;
80213 bool num3 = TileLoader.Drop(i, j, type);
80214 KillTile(i, num);
80215 KillTile(i, num + 1);
80216 KillTile(i, num + 2);
80217 if (num3)
80218 {
80219 DropDoorItem(i, j, num2);
80220 }
80221 }
80222 destroyObject = false;
80223 }
static bool Drop(int i, int j, int type, bool includeLargeObjectDrops=true)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
static bool destroyObject
Definition WorldGen.cs:1258
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.ModLoader.TileLoader.Drop(), Terraria.Tile.frameY, Terraria.Enums.SolidTile, and Terraria.Main.tile.

+ Here is the call graph for this function: