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

◆ CheckLilyPad()

static void Terraria.WorldGen.CheckLilyPad ( int x,
int y )
inlinestatic

Definition at line 53474 of file WorldGen.cs.

53475 {
53476 if (Main.netMode == 1)
53477 {
53478 return;
53479 }
53480 Tile tile = Main.tile[x, y];
53481 if (tile.liquidType() != 0)
53482 {
53483 KillTile(x, y);
53484 if (Main.netMode == 2)
53485 {
53486 NetMessage.SendData(17, -1, -1, null, 0, x, y);
53487 }
53488 return;
53489 }
53490 int num = y;
53491 while (true)
53492 {
53493 tile = Main.tile[x, num];
53494 if (tile.active())
53495 {
53496 bool[] tileSolid = Main.tileSolid;
53497 tile = Main.tile[x, num];
53498 if (tileSolid[tile.type])
53499 {
53500 bool[] tileSolidTop = Main.tileSolidTop;
53501 tile = Main.tile[x, num];
53502 if (!tileSolidTop[tile.type])
53503 {
53504 break;
53505 }
53506 }
53507 }
53508 if (num >= Main.maxTilesY - 50)
53509 {
53510 break;
53511 }
53512 num++;
53513 if (Main.tile[x, num] == null)
53514 {
53515 return;
53516 }
53517 }
53518 tile = Main.tile[x, num];
53519 int type = tile.type;
53520 int num2 = -1;
53521 if (type == 2 || type == 477)
53522 {
53523 num2 = 0;
53524 }
53525 if (type == 109 || type == 109 || type == 116)
53526 {
53527 num2 = 18;
53528 }
53529 if (type == 60)
53530 {
53531 num2 = 36;
53532 }
53533 if (num2 >= 0)
53534 {
53535 int num3 = num2;
53536 tile = Main.tile[x, y];
53537 if (num3 != tile.frameY)
53538 {
53539 tile = Main.tile[x, y];
53540 tile.frameY = (short)num2;
53541 if (Main.netMode == 2)
53542 {
53543 NetMessage.SendTileSquare(-1, x, y);
53544 }
53545 }
53546 tile = Main.tile[x, y - 1];
53547 if (tile.liquid > 0)
53548 {
53549 tile = Main.tile[x, y - 1];
53550 if (!tile.active())
53551 {
53552 tile = Main.tile[x, y - 1];
53553 tile.active(active: true);
53554 tile = Main.tile[x, y - 1];
53555 tile.type = 518;
53556 tile = Main.tile[x, y - 1];
53557 ref short frameX = ref tile.frameX;
53558 tile = Main.tile[x, y];
53559 frameX = tile.frameX;
53560 tile = Main.tile[x, y - 1];
53561 ref short frameY = ref tile.frameY;
53562 tile = Main.tile[x, y];
53563 frameY = tile.frameY;
53564 tile = Main.tile[x, y - 1];
53565 tile.halfBrick(halfBrick: false);
53566 tile = Main.tile[x, y - 1];
53567 tile.slope(0);
53568 tile = Main.tile[x, y];
53569 tile.active(active: false);
53570 tile = Main.tile[x, y];
53571 tile.type = 0;
53572 SquareTileFrame(x, y - 1, resetFrame: false);
53573 if (Main.netMode == 2)
53574 {
53575 NetMessage.SendTileSquare(-1, x, y - 1, 1, 2);
53576 }
53577 return;
53578 }
53579 }
53580 tile = Main.tile[x, y];
53581 if (tile.liquid != 0)
53582 {
53583 return;
53584 }
53585 Tile tileSafely = Framing.GetTileSafely(x, y + 1);
53586 if (!tileSafely.active())
53587 {
53588 tile = Main.tile[x, y + 1];
53589 tile.active(active: true);
53590 tile = Main.tile[x, y + 1];
53591 tile.type = 518;
53592 tile = Main.tile[x, y + 1];
53593 ref short frameX2 = ref tile.frameX;
53594 tile = Main.tile[x, y];
53595 frameX2 = tile.frameX;
53596 tile = Main.tile[x, y + 1];
53597 ref short frameY2 = ref tile.frameY;
53598 tile = Main.tile[x, y];
53599 frameY2 = tile.frameY;
53600 tile = Main.tile[x, y + 1];
53601 tile.halfBrick(halfBrick: false);
53602 tile = Main.tile[x, y + 1];
53603 tile.slope(0);
53604 tile = Main.tile[x, y];
53605 tile.active(active: false);
53606 tile = Main.tile[x, y];
53607 tile.type = 0;
53608 SquareTileFrame(x, y + 1, resetFrame: false);
53609 if (Main.netMode == 2)
53610 {
53611 NetMessage.SendTileSquare(-1, x, y, 1, 2);
53612 }
53613 }
53614 else if (tileSafely.active() && !TileID.Sets.Platforms[tileSafely.type] && (!Main.tileSolid[tileSafely.type] || Main.tileSolidTop[tileSafely.type]))
53615 {
53616 KillTile(x, y);
53617 if (Main.netMode == 2)
53618 {
53619 NetMessage.SendData(17, -1, -1, null, 0, x, y);
53620 }
53621 }
53622 }
53623 else
53624 {
53625 KillTile(x, y);
53626 if (Main.netMode == 2)
53627 {
53628 NetMessage.SendData(17, -1, -1, null, 0, x, y);
53629 }
53630 }
53631 }
static bool[] Platforms
Definition TileID.cs:219
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.Tile.active(), Terraria.Tile.frameX, Terraria.Tile.frameY, Terraria.Framing.GetTileSafely(), Terraria.Tile.halfBrick(), Terraria.Tile.liquid, Terraria.Tile.liquidType(), Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.ID.TileID.Sets.Platforms, Terraria.NetMessage.SendData(), Terraria.NetMessage.SendTileSquare(), Terraria.Tile.slope(), Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, and Terraria.Tile.type.

Referenced by Terraria.Liquid.DelWater().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: