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

◆ CheckTallGate()

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

Definition at line 45534 of file WorldGen.cs.

45535 {
45536 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
45537 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
45538 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
45539 //IL_0175: Unknown result type (might be due to invalid IL or missing references)
45540 if (destroyObject)
45541 {
45542 return;
45543 }
45544 bool flag = false;
45545 Tile tileSafely = Framing.GetTileSafely(x, y);
45546 Point point = default(Point);
45547 ((Point)(ref point))._002Ector(tileSafely.frameX / 18, 0);
45549 point.Y = tileSafely.frameY / tileData.CoordinateFullHeight;
45550 int width = tileData.Width;
45551 int height = tileData.Height;
45552 int i = 0;
45553 for (int num = tileSafely.frameY % tileData.CoordinateFullHeight; i < height && num - tileData.CoordinateHeights[i] >= 0; i++)
45554 {
45555 num -= tileData.CoordinateHeights[i];
45556 }
45557 _ = tileData.CoordinateFullHeight;
45558 y -= i;
45559 int num2 = point.Y * tileData.CoordinateFullHeight;
45560 for (int j = 0; j < height; j++)
45561 {
45562 tileSafely = Framing.GetTileSafely(x, y + j);
45563 if (tileSafely.frameX != point.X * tileData.CoordinateFullWidth || tileSafely.frameY != num2)
45564 {
45565 flag = true;
45566 break;
45567 }
45568 num2 += tileData.CoordinateHeights[j] + tileData.CoordinatePadding;
45569 }
45570 if (!flag && CheckTileAnchors(x, y, width, height, 2, AnchorType.SolidTile))
45571 {
45572 return;
45573 }
45574 destroyObject = true;
45575 bool drop = TileLoader.Drop(x, y, type);
45576 for (int k = x; k < x + width; k++)
45577 {
45578 for (int l = y; l < y + height; l++)
45579 {
45580 KillTile(k, l);
45581 }
45582 }
45583 using (new Item.DisableNewItemMethod(!drop))
45584 {
45585 int type2 = 3240;
45586 if (point.Y == 0)
45587 {
45588 type2 = 3240;
45589 }
45590 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, width * 16, height * 16, type2);
45591 for (int m = x - 1; m < x + width + 1; m++)
45592 {
45593 for (int n = y - 1; n < y + height + 1; n++)
45594 {
45595 TileFrame(m, n);
45596 }
45597 }
45598 destroyObject = false;
45599 }
45600 }
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 TileObjectData GetTileData(int type, int style, int alternate=0)
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 TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool CheckTileAnchors(int sx, int sy, int w, int h, int mode, AnchorType anchor)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.ModLoader.TileLoader.Drop(), Terraria.ObjectData.TileObjectData.GetTileData(), Terraria.Framing.GetTileSafely(), and Terraria.Item.NewItem().

+ Here is the call graph for this function: