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

◆ GetBirdFlightRecommendation()

void Terraria.NPC.GetBirdFlightRecommendation ( int downScanRange,
int upRange,
Point tCoords,
out bool goDownwards,
out bool goUpwards )
inlineprivate

Definition at line 41905 of file NPC.cs.

41906 {
41907 tCoords.X += direction;
41908 goDownwards = true;
41909 goUpwards = false;
41910 int x = tCoords.X;
41911 for (int i = tCoords.Y; i < tCoords.Y + downScanRange && WorldGen.InWorld(x, i); i++)
41912 {
41913 Tile tile = Main.tile[x, i];
41914 if (tile == null)
41915 {
41916 break;
41917 }
41918 if ((tile.nactive() && Main.tileSolid[tile.type]) || tile.liquid > 0)
41919 {
41920 if (i < tCoords.Y + upRange)
41921 {
41922 goUpwards = true;
41923 }
41924 goDownwards = false;
41925 break;
41926 }
41927 }
41928 }

References Terraria.Entity.direction, Terraria.WorldGen.InWorld(), Terraria.Tile.nactive(), Terraria.Main.tile, Terraria.Main.tileSolid, and Terraria.Tile.type.

Referenced by Terraria.NPC.AI_112_FairyCritter().