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

◆ CheckGnome()

static void Terraria.WorldGen.CheckGnome ( int x,
int j )
inlinestatic

Definition at line 45558 of file WorldGen.cs.

45559 {
45560 if (destroyObject)
45561 {
45562 return;
45563 }
45564 int num = 567;
45565 int num2 = j;
45566 bool flag = true;
45567 Tile tileSafely = Framing.GetTileSafely(x, num2);
45568 Tile tileSafely2 = Framing.GetTileSafely(x, num2 + 1);
45569 if (tileSafely.frameY > 0)
45570 {
45571 num2--;
45572 tileSafely = Framing.GetTileSafely(x, num2);
45573 tileSafely2 = Framing.GetTileSafely(x, num2 + 1);
45574 }
45575 _ = tileSafely.frameX / 28;
45576 if (tileSafely.frameY == 0 && tileSafely2.frameY == 20 && tileSafely.type == num && tileSafely2.type == num)
45577 {
45578 flag = false;
45579 }
45580 if (Main.tile[x, num2 + 2] == null)
45581 {
45582 Main.tile[x, num2 + 2] = new Tile();
45583 }
45584 if (!SolidTileAllowBottomSlope(x, num2 + 2) && !TileID.Sets.Platforms[Main.tile[x, num2 + 2].type])
45585 {
45586 flag = true;
45587 }
45588 if (flag)
45589 {
45590 destroyObject = true;
45591 if (tileSafely.type == num)
45592 {
45593 KillTile(x, num2);
45594 }
45595 if (tileSafely2.type == num)
45596 {
45597 KillTile(x, num2 + 1);
45598 }
45599 Item.NewItem(GetItemSource_FromTileBreak(x, num2), x * 16, num2 * 16, 16, 32, 4609);
45600 destroyObject = false;
45601 }
45602 }
static bool[] Platforms
Definition TileID.cs:163
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static bool SolidTileAllowBottomSlope(int i, int j)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.Framing.GetTileSafely(), Terraria.Item.NewItem(), Terraria.ID.TileID.Sets.Platforms, Terraria.DataStructures.Tile, and Terraria.Main.tile.