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

◆ AI_061_FishingBobber_GetWaterLine()

float Terraria.Projectile.AI_061_FishingBobber_GetWaterLine ( int X,
int Y )
inlineprivate

Definition at line 44037 of file Projectile.cs.

44038 {
44039 float result = position.Y + (float)height;
44040 if (Main.tile[X, Y - 1] == null)
44041 {
44042 Main.tile[X, Y - 1] = new Tile();
44043 }
44044 if (Main.tile[X, Y] == null)
44045 {
44046 Main.tile[X, Y] = new Tile();
44047 }
44048 if (Main.tile[X, Y + 1] == null)
44049 {
44050 Main.tile[X, Y + 1] = new Tile();
44051 }
44052 if (Main.tile[X, Y - 1].liquid > 0)
44053 {
44054 result = Y * 16;
44055 result -= (float)(Main.tile[X, Y - 1].liquid / 16);
44056 }
44057 else if (Main.tile[X, Y].liquid > 0)
44058 {
44059 result = (Y + 1) * 16;
44060 result -= (float)(Main.tile[X, Y].liquid / 16);
44061 }
44062 else if (Main.tile[X, Y + 1].liquid > 0)
44063 {
44064 result = (Y + 2) * 16;
44065 result -= (float)(Main.tile[X, Y + 1].liquid / 16);
44066 }
44067 return result;
44068 }

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