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

◆ GetWaterLine() [1/2]

static bool Terraria.Collision.GetWaterLine ( int X,
int Y,
out float waterLineHeight )
inlinestatic

Definition at line 1289 of file Collision.cs.

1290 {
1291 waterLineHeight = 0f;
1292 if (Main.tile[X, Y - 2] == null)
1293 {
1294 Main.tile[X, Y - 2] = new Tile();
1295 }
1296 if (Main.tile[X, Y - 1] == null)
1297 {
1298 Main.tile[X, Y - 1] = new Tile();
1299 }
1300 if (Main.tile[X, Y] == null)
1301 {
1302 Main.tile[X, Y] = new Tile();
1303 }
1304 if (Main.tile[X, Y + 1] == null)
1305 {
1306 Main.tile[X, Y + 1] = new Tile();
1307 }
1308 if (Main.tile[X, Y - 2].liquid > 0)
1309 {
1310 return false;
1311 }
1312 if (Main.tile[X, Y - 1].liquid > 0)
1313 {
1314 waterLineHeight = Y * 16;
1315 waterLineHeight -= Main.tile[X, Y - 1].liquid / 16;
1316 return true;
1317 }
1318 if (Main.tile[X, Y].liquid > 0)
1319 {
1320 waterLineHeight = (Y + 1) * 16;
1321 waterLineHeight -= Main.tile[X, Y].liquid / 16;
1322 return true;
1323 }
1324 if (Main.tile[X, Y + 1].liquid > 0)
1325 {
1326 waterLineHeight = (Y + 2) * 16;
1327 waterLineHeight -= Main.tile[X, Y + 1].liquid / 16;
1328 return true;
1329 }
1330 return false;
1331 }

References Terraria.DataStructures.Tile, Terraria.Main.tile, System.X, and System.Y.