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

◆ GetVanityTreeFoliageData()

static bool Terraria.WorldGen.GetVanityTreeFoliageData ( int i,
int j,
int xoffset,
ref int treeFrame,
ref int treeStyle,
out int floorY,
out int topTextureFrameWidth,
out int topTextureFrameHeight )
inlinestatic

Definition at line 53471 of file WorldGen.cs.

53472 {
53473 Tile tile = Main.tile[i, j];
53474 int num = i + xoffset;
53477 floorY = j;
53478 for (int k = 0; k < 100; k++)
53479 {
53480 floorY = j + k;
53481 Tile tile2 = Main.tile[num, floorY];
53482 if (tile2 == null)
53483 {
53484 return false;
53485 }
53486 if (TileID.Sets.Conversion.Grass[tile2.type])
53487 {
53488 switch (tile.type)
53489 {
53490 case 596:
53491 treeStyle = 29;
53492 return true;
53493 case 616:
53494 treeStyle = 30;
53495 return true;
53496 }
53497 }
53498 }
53499 return false;
53500 }

References Terraria.ID.TileID.Sets.Conversion.Grass, Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.GameContent.Drawing.TileDrawing.DrawTrees(), and Terraria.GameContent.Drawing.TileDrawing.MakeExtraPreparations().