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

◆ AnchorValid()

static bool Terraria.WorldGen.AnchorValid ( Tile tileCache,
AnchorType anchor )
inlinestatic

Definition at line 45719 of file WorldGen.cs.

45720 {
45721 bool flag = false;
45722 if (tileCache.nactive())
45723 {
45724 if ((anchor & AnchorType.SolidTile) == AnchorType.SolidTile && Main.tileSolid[tileCache.type] && !Main.tileSolidTop[tileCache.type] && !Main.tileNoAttach[tileCache.type] && tileCache.blockType() == 0)
45725 {
45726 flag = true;
45727 }
45728 if ((anchor & AnchorType.SolidBottom) == AnchorType.SolidBottom && ((Main.tileSolid[tileCache.type] && (!Main.tileSolidTop[tileCache.type] || (TileID.Sets.Platforms[tileCache.type] && (tileCache.halfBrick() || tileCache.topSlope())))) || tileCache.topSlope() || tileCache.halfBrick()) && !TileID.Sets.NotReallySolid[tileCache.type] && !tileCache.bottomSlope())
45729 {
45730 flag = true;
45731 }
45732 if (!flag && ((anchor & AnchorType.SolidWithTop) == AnchorType.SolidWithTop || (anchor & AnchorType.Table) == AnchorType.Table))
45733 {
45734 if (TileID.Sets.Platforms[tileCache.type])
45735 {
45736 int num = tileCache.frameX / TileObjectData.PlatformFrameWidth();
45737 if ((!tileCache.halfBrick() && num >= 0 && num <= 7) || (num >= 12 && num <= 16) || (num >= 25 && num <= 26))
45738 {
45739 flag = true;
45740 }
45741 }
45742 else if (Main.tileSolid[tileCache.type] && Main.tileSolidTop[tileCache.type])
45743 {
45744 flag = true;
45745 }
45746 }
45747 if (!flag && (anchor & AnchorType.Table) == AnchorType.Table && !TileID.Sets.Platforms[tileCache.type] && Main.tileTable[tileCache.type] && tileCache.blockType() == 0)
45748 {
45749 flag = true;
45750 }
45751 if (!flag && (anchor & AnchorType.SolidSide) == AnchorType.SolidSide && Main.tileSolid[tileCache.type] && !Main.tileSolidTop[tileCache.type] && (uint)(tileCache.blockType() - 4) <= 1u)
45752 {
45753 flag = true;
45754 }
45755 }
45756 else if (!flag && (anchor & AnchorType.EmptyTile) == AnchorType.EmptyTile)
45757 {
45758 flag = true;
45759 }
45760 return flag;
45761 }
static bool[] NotReallySolid
Definition TileID.cs:324
static bool[] Platforms
Definition TileID.cs:219

References Terraria.Tile.blockType(), Terraria.Tile.bottomSlope(), Terraria.Tile.halfBrick(), Terraria.Tile.nactive(), Terraria.ID.TileID.Sets.NotReallySolid, Terraria.ObjectData.TileObjectData.PlatformFrameWidth(), Terraria.ID.TileID.Sets.Platforms, Terraria.Main.tileNoAttach, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, Terraria.Main.tileTable, Terraria.Tile.topSlope(), and Terraria.Tile.type.

+ Here is the call graph for this function: