public static AddBuffer ( int x, int y ) : void | ||
x | int | |
y | int | |
return | void |
public static void AddWater(int x, int y) { Tile tile = Main.tile[x, y]; if (Main.tile[x, y] == null || tile.checkingLiquid() || x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5 || x < 5 || y < 5 || tile.liquid == 0) { return; } if (numLiquid >= maxLiquid - 1) { LiquidBuffer.AddBuffer(x, y); return; } tile.checkingLiquid(true); Main.liquid[numLiquid].kill = 0; Main.liquid[numLiquid].x = x; Main.liquid[numLiquid].y = y; Main.liquid[numLiquid].delay = 0; tile.skipLiquid(false); numLiquid++; if (Main.netMode == 2) { NetSendLiquid(x, y); } if (!tile.active() || WorldGen.gen) { return; } bool flag = false; if (tile.lava()) { if (TileObjectData.CheckLavaDeath(tile)) { flag = true; } } else if (TileObjectData.CheckWaterDeath(tile)) { flag = true; } if (flag) { WorldGen.KillTile(x, y); if (Main.netMode == 2) { NetMessage.SendData(17, -1, -1, "", 0, x, y); } } }
public static void NetAddWater(int x, int y) { if (((((x < (Main.maxTilesX - 5)) && (y < (Main.maxTilesY - 5))) && ((x >= 5) && (y >= 5))) && (Main.tile[x, y] != null)) && (Main.tile[x, y].liquid != 0)) { for (int i = 0; i < numLiquid; i++) { if ((Main.liquid[i].x == x) && (Main.liquid[i].y == y)) { Main.liquid[i].kill = 0; Main.tile[x, y].skipLiquid = true; return; } } if (numLiquid >= (maxLiquid - 1)) { LiquidBuffer.AddBuffer(x, y); } else { Main.tile[x, y].checkingLiquid = true; Main.tile[x, y].skipLiquid = true; Main.liquid[numLiquid].kill = 0; Main.liquid[numLiquid].x = x; Main.liquid[numLiquid].y = y; numLiquid++; if (Main.netMode == 2) { NetMessage.sendWater(x, y); } if (Main.tile[x, y].active && (Main.tileWaterDeath[Main.tile[x, y].type] || (Main.tile[x, y].lava && Main.tileLavaDeath[Main.tile[x, y].type]))) { WorldGen.KillTile(x, y, false, false, false); if (Main.netMode == 2) { NetMessage.SendData(0x11, -1, -1, "", 0, (float)x, (float)y, 0f); } } } } }
public static void AddWater(int x, int y) { if ((((!Main.tile[x, y].checkingLiquid && ((x < (Main.maxTilesX - 5)) && (y < (Main.maxTilesY - 5)))) && ((x >= 5) && (y >= 5))) && (Main.tile[x, y] != null)) && (Main.tile[x, y].liquid != 0)) { if (numLiquid >= (maxLiquid - 1)) { LiquidBuffer.AddBuffer(x, y); } else { Main.tile[x, y].checkingLiquid = true; Main.liquid[numLiquid].kill = 0; Main.liquid[numLiquid].x = x; Main.liquid[numLiquid].y = y; Main.liquid[numLiquid].delay = 0; Main.tile[x, y].skipLiquid = false; numLiquid++; if ((Main.netMode == 2) && (numLiquid < (maxLiquid / 3))) { NetMessage.sendWater(x, y); } if ((Main.tile[x, y].active && (Main.tileWaterDeath[Main.tile[x, y].type] || (Main.tile[x, y].lava && Main.tileLavaDeath[Main.tile[x, y].type]))) && ((Main.tile[x, y].type != 4) || (Main.tile[x, y].frameY != 0xb0))) { if (WorldGen.gen) { Main.tile[x, y].active = false; } else { WorldGen.KillTile(x, y, false, false, false); if (Main.netMode == 2) { NetMessage.SendData(0x11, -1, -1, "", 0, (float)x, (float)y, 0f, 0); } } } } } }