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

◆ FindCattailTop()

static bool Terraria.NPC.FindCattailTop ( int landX,
int landY,
out int cattailX,
out int cattailY )
inlinestatic

Definition at line 90416 of file NPC.cs.

90417 {
90418 cattailX = landX;
90419 cattailY = landY;
90420 if (!WorldGen.InWorld(landX, landY, 31))
90421 {
90422 return false;
90423 }
90424 int num = 1;
90425 for (int i = landX - 30; i <= landX + 30; i++)
90426 {
90427 for (int j = landY - 20; j <= landY + 20; j++)
90428 {
90429 Tile tile = Main.tile[i, j];
90430 if (tile != null && tile.active() && tile.type == 519 && tile.frameX >= 180 && Main.rand.Next(num) == 0)
90431 {
90432 cattailX = i;
90433 cattailY = j;
90434 num++;
90435 }
90436 }
90437 }
90438 if (cattailX != landX || cattailY != landY)
90439 {
90440 return true;
90441 }
90442 return false;
90443 }

References Terraria.Tile.active(), Terraria.Tile.frameX, Terraria.WorldGen.InWorld(), Terraria.Main.rand, Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.NPC.AI_114_Dragonflies().

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