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

◆ IsTileReplacable()

static bool Terraria.WorldGen.IsTileReplacable ( int x,
int y )
inlinestatic

Definition at line 53020 of file WorldGen.cs.

53021 {
53022 Tile tile = Main.tile[x, y];
53023 if (y >= 1)
53024 {
53025 Tile tile2 = Main.tile[x, y - 1];
53026 if (tile == null || tile2 == null)
53027 {
53028 return false;
53029 }
53030 if (tile2.active())
53031 {
53032 if (tile2.type == 80)
53033 {
53034 return false;
53035 }
53036 if (tile2.type == 488)
53037 {
53038 return false;
53039 }
53040 if (TileID.Sets.PreventsTileReplaceIfOnTopOfIt[tile2.type] && tile.type != tile2.type)
53041 {
53042 if (TileID.Sets.IsATreeTrunk[tile2.type])
53043 {
53044 if ((tile2.frameX == 66 && tile2.frameY >= 0 && tile2.frameY <= 44) || (tile2.frameX == 88 && tile2.frameY >= 66 && tile2.frameY <= 110) || tile2.frameY >= 198)
53045 {
53046 return true;
53047 }
53048 return false;
53049 }
53050 if (tile2.type == 323)
53051 {
53052 if (tile2.frameX == 66 || tile2.frameX == 220)
53053 {
53054 return false;
53055 }
53056 return true;
53057 }
53058 return false;
53059 }
53060 }
53061 }
53062 return true;
53063 }
static bool[] PreventsTileReplaceIfOnTopOfIt
Definition TileID.cs:101
static bool[] IsATreeTrunk
Definition TileID.cs:91

References Terraria.ID.TileID.Sets.IsATreeTrunk, Terraria.ID.TileID.Sets.PreventsTileReplaceIfOnTopOfIt, Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.Player.PlaceThing_TryReplacingTiles().