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

◆ TryKillingReplaceableTile()

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

Definition at line 50240 of file WorldGen.cs.

50241 {
50242 if (!InWorld(x, y, 2))
50243 {
50244 return false;
50245 }
50246 if (Main.tile[x, y].active() && (Main.tileCut[Main.tile[x, y].type] || TileID.Sets.BreakableWhenPlacing[Main.tile[x, y].type] || (Main.tile[x, y].type >= 373 && Main.tile[x, y].type <= 375) || Main.tile[x, y].type == 461))
50247 {
50248 if (Main.tile[x, y].type != tileType)
50249 {
50250 bool num = Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380 && Main.tile[x, y + 1].type != 579;
50251 bool flag = Main.tile[x, y].type == 3 || Main.tile[x, y].type == 73;
50252 bool flag2 = Main.tileAlch[Main.tile[x, y].type] && IsHarvestableHerbWithSeed(Main.tile[x, y].type, Main.tile[x, y].frameX / 18);
50253 bool flag3 = Main.tileAlch[tileType];
50254 if (num || ((flag || flag2) && flag3))
50255 {
50256 KillTile(x, y);
50257 if (!Main.tile[x, y].active() && Main.netMode != 0)
50258 {
50259 NetMessage.SendData(17, -1, -1, null, 0, x, y);
50260 }
50261 return true;
50262 }
50263 return false;
50264 }
50265 return false;
50266 }
50267 return false;
50268 }
static bool[] BreakableWhenPlacing
Definition TileID.cs:277
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:5816
static bool IsHarvestableHerbWithSeed(int type, int style)

References Terraria.ID.TileID.Sets.BreakableWhenPlacing, Terraria.Main.netMode, Terraria.NetMessage.SendData(), Terraria.Main.tile, Terraria.Main.tileAlch, and Terraria.Main.tileCut.

Referenced by Terraria.DelegateMethods.SpreadDirt().