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

◆ FixHeart()

static void Terraria.WorldGen.FixHeart ( int i,
int j )
inlinestatic

Definition at line 44312 of file WorldGen.cs.

44313 {
44314 if (i < Main.offLimitBorderTiles || i >= Main.maxTilesX - Main.offLimitBorderTiles || j < Main.offLimitBorderTiles || j >= Main.maxTilesY - Main.offLimitBorderTiles)
44315 {
44316 DestroyHeart(i, j);
44317 return;
44318 }
44319 Tile tile = Main.tile[i, j + 2];
44320 Tile tile2 = Main.tile[i + 1, j + 2];
44321 if (tile.active() && !Main.tileSolid[tile.type] && Main.tileCut[tile.type])
44322 {
44323 KillTile(i, j + 2);
44324 }
44325 if (tile2.active() && !Main.tileSolid[tile2.type] && Main.tileCut[tile2.type])
44326 {
44327 KillTile(i + 1, j + 2);
44328 }
44329 if (!tile.active())
44330 {
44331 if (!tile2.active())
44332 {
44333 DestroyHeart(i, j);
44334 return;
44335 }
44336 if (Main.tileSolid[tile2.type])
44337 {
44338 tile.type = tile2.type;
44339 tile.active(active: true);
44340 }
44341 }
44342 if (!tile2.active() && Main.tileSolid[tile.type])
44343 {
44344 tile2.type = tile.type;
44345 tile2.active(active: true);
44346 }
44347 if (!tile.nactive() || !Main.tileSolid[tile.type] || !tile2.nactive() || !Main.tileSolid[tile2.type])
44348 {
44349 DestroyHeart(i, j);
44350 return;
44351 }
44352 if (tile.blockType() != 0)
44353 {
44354 tile.slope(0);
44355 tile.halfBrick(halfBrick: false);
44356 }
44357 if (tile2.blockType() != 0)
44358 {
44359 tile2.slope(0);
44360 tile2.halfBrick(halfBrick: false);
44361 }
44362 }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void DestroyHeart(int i, int j)

References Terraria.Tile.active(), Terraria.Tile.blockType(), Terraria.Tile.halfBrick(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Tile.nactive(), Terraria.Main.offLimitBorderTiles, Terraria.Tile.slope(), Terraria.Main.tile, Terraria.Main.tileCut, Terraria.Main.tileSolid, and Terraria.Tile.type.