Terraria v1.4.4.9
Terraria 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 54060 of file WorldGen.cs.

54061 {
54062 x = i;
54063 y = j;
54064 Tile tileSafely = Framing.GetTileSafely(x, y);
54065 if (tileSafely.type == 323)
54066 {
54067 while (y < Main.maxTilesY - 50 && (!tileSafely.active() || tileSafely.type == 323))
54068 {
54069 y++;
54070 tileSafely = Framing.GetTileSafely(x, y);
54071 }
54072 return;
54073 }
54074 int num = tileSafely.frameX / 22;
54075 int num2 = tileSafely.frameY / 22;
54076 if (num == 3 && num2 <= 2)
54077 {
54078 x++;
54079 }
54080 else if (num == 4 && num2 >= 3 && num2 <= 5)
54081 {
54082 x--;
54083 }
54084 else if (num == 1 && num2 >= 6 && num2 <= 8)
54085 {
54086 x--;
54087 }
54088 else if (num == 2 && num2 >= 6 && num2 <= 8)
54089 {
54090 x++;
54091 }
54092 else if (num == 2 && num2 >= 9)
54093 {
54094 x++;
54095 }
54096 else if (num == 3 && num2 >= 9)
54097 {
54098 x--;
54099 }
54100 tileSafely = Framing.GetTileSafely(x, y);
54101 while (y < Main.maxTilesY - 50 && (!tileSafely.active() || TileID.Sets.IsATreeTrunk[tileSafely.type] || tileSafely.type == 72))
54102 {
54103 y++;
54104 tileSafely = Framing.GetTileSafely(x, y);
54105 }
54106 }
static bool[] IsATreeTrunk
Definition TileID.cs:91

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