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

◆ GetTreeBottom()

static void Terraria.WorldGen.GetTreeBottom ( int i,
int j,
out int x,
out int y )
inlinestatic

Definition at line 57673 of file WorldGen.cs.

57674 {
57675 x = i;
57676 y = j;
57677 Tile tileSafely = Framing.GetTileSafely(x, y);
57678 if (tileSafely.type == 323)
57679 {
57680 while (y < Main.maxTilesY - 50 && (!tileSafely.active() || tileSafely.type == 323))
57681 {
57682 y++;
57683 tileSafely = Framing.GetTileSafely(x, y);
57684 }
57685 return;
57686 }
57687 int num = tileSafely.frameX / 22;
57688 int num2 = tileSafely.frameY / 22;
57689 if (num == 3 && num2 <= 2)
57690 {
57691 x++;
57692 }
57693 else if (num == 4 && num2 >= 3 && num2 <= 5)
57694 {
57695 x--;
57696 }
57697 else if (num == 1 && num2 >= 6 && num2 <= 8)
57698 {
57699 x--;
57700 }
57701 else if (num == 2 && num2 >= 6 && num2 <= 8)
57702 {
57703 x++;
57704 }
57705 else if (num == 2 && num2 >= 9)
57706 {
57707 x++;
57708 }
57709 else if (num == 3 && num2 >= 9)
57710 {
57711 x--;
57712 }
57713 tileSafely = Framing.GetTileSafely(x, y);
57714 while (y < Main.maxTilesY - 50 && (!tileSafely.active() || TileID.Sets.IsATreeTrunk[tileSafely.type] || tileSafely.type == 72))
57715 {
57716 y++;
57717 tileSafely = Framing.GetTileSafely(x, y);
57718 }
57719 }
static bool[] IsATreeTrunk
If true for a given tile type (P:Terraria.Tile.TileType), then that tile is categorized as a tree tru...
Definition TileID.cs:114

References Terraria.Framing.GetTileSafely(), Terraria.ID.TileID.Sets.IsATreeTrunk, and Terraria.Main.maxTilesY.

+ Here is the call graph for this function: