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

◆ AI_007_TownEntities_IsInAGoodRestingSpot()

bool Terraria.NPC.AI_007_TownEntities_IsInAGoodRestingSpot ( int tileX,
int tileY,
int idealRestX,
int idealRestY )
inlineprivate

Definition at line 46069 of file NPC.cs.

46070 {
46071 if (!Main.dayTime && ai[0] == 5f)
46072 {
46073 if (Math.Abs(tileX - idealRestX) <= 7)
46074 {
46075 return Math.Abs(tileY - idealRestY) <= 7;
46076 }
46077 return false;
46078 }
46079 if ((type == 361 || type == 445 || type == 687) && wet)
46080 {
46081 return false;
46082 }
46083 if (tileX == idealRestX)
46084 {
46085 return tileY == idealRestY;
46086 }
46087 return false;
46088 }
static double Abs(double value)
float[] ai
Definition NPC.cs:447
int type
Definition NPC.cs:445

References System.Math.Abs(), Terraria.NPC.ai, Terraria.Main.dayTime, Terraria.NPC.type, and Terraria.Entity.wet.

Referenced by Terraria.NPC.AI_007_TownEntities().