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

◆ WaterCheck()

static void Terraria.WorldGen.WaterCheck ( )
inlinestatic

Definition at line 74104 of file WorldGen.cs.

74105 {
74106 Liquid.tilesIgnoreWater(ignoreSolids: true);
74107 Liquid.numLiquid = 0;
74108 LiquidBuffer.numLiquidBuffer = 0;
74109 for (int i = 1; i < Main.maxTilesX - 1; i++)
74110 {
74111 for (int num = Main.maxTilesY - 2; num > 0; num--)
74112 {
74113 Tile tile = Main.tile[i, num];
74114 tile.checkingLiquid(checkingLiquid: false);
74115 if (tile.liquid > 0 && tile.nactive() && Main.tileSolid[tile.type] && !Main.tileSolidTop[tile.type])
74116 {
74117 tile.liquid = 0;
74118 }
74119 else if (tile.liquid > 0)
74120 {
74121 if (tile.active())
74122 {
74123 if (tile.lava())
74124 {
74126 {
74127 KillTile(i, num);
74128 }
74129 }
74130 else if (TileObjectData.CheckWaterDeath(tile))
74131 {
74132 KillTile(i, num);
74133 }
74134 }
74135 Tile tile2 = Main.tile[i, num + 1];
74136 if ((!tile2.nactive() || !Main.tileSolid[tile2.type] || Main.tileSolidTop[tile2.type]) && tile2.liquid < byte.MaxValue)
74137 {
74138 if (tile2.liquid > 250)
74139 {
74140 tile2.liquid = byte.MaxValue;
74141 }
74142 else
74143 {
74144 Liquid.AddWater(i, num);
74145 }
74146 }
74147 Tile tile3 = Main.tile[i - 1, num];
74148 Tile tile4 = Main.tile[i + 1, num];
74149 if ((!tile3.nactive() || !Main.tileSolid[tile3.type] || Main.tileSolidTop[tile3.type]) && tile3.liquid != tile.liquid)
74150 {
74151 Liquid.AddWater(i, num);
74152 }
74153 else if ((!tile4.nactive() || !Main.tileSolid[tile4.type] || Main.tileSolidTop[tile4.type]) && tile4.liquid != tile.liquid)
74154 {
74155 Liquid.AddWater(i, num);
74156 }
74157 if (tile.lava())
74158 {
74159 if (tile3.liquid > 0 && !tile3.lava())
74160 {
74161 Liquid.AddWater(i, num);
74162 }
74163 else if (tile4.liquid > 0 && !tile4.lava())
74164 {
74165 Liquid.AddWater(i, num);
74166 }
74167 else if (Main.tile[i, num - 1].liquid > 0 && !Main.tile[i, num - 1].lava())
74168 {
74169 Liquid.AddWater(i, num);
74170 }
74171 else if (tile2.liquid > 0 && !tile2.lava())
74172 {
74173 Liquid.AddWater(i, num);
74174 }
74175 }
74176 }
74177 }
74178 }
74179 Liquid.tilesIgnoreWater(ignoreSolids: false);
74180 }
static bool CheckWaterDeath(int type, int style)
static bool CheckLavaDeath(int type, int style)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)

References Terraria.Tile.active(), Terraria.Liquid.AddWater(), Terraria.Tile.checkingLiquid(), Terraria.ObjectData.TileObjectData.CheckLavaDeath(), Terraria.ObjectData.TileObjectData.CheckWaterDeath(), Terraria.Tile.lava(), Terraria.Tile.liquid, Terraria.Main.maxTilesY, Terraria.Tile.nactive(), Terraria.Main.tile, Terraria.Liquid.tilesIgnoreWater(), Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, and Terraria.Tile.type.

Referenced by Terraria.IO.WorldFile.LoadWorld(), and Terraria.Liquid.UpdateLiquid().

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