TModLoader v1.4.4.9
TModLoader 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 56045 of file NPC.cs.

56046 {
56047 if (!Main.dayTime && ai[0] == 5f)
56048 {
56049 if (Math.Abs(tileX - idealRestX) <= 7)
56050 {
56051 return Math.Abs(tileY - idealRestY) <= 7;
56052 }
56053 return false;
56054 }
56055 if ((type == 361 || type == 445 || type == 687) && wet)
56056 {
56057 return false;
56058 }
56059 if (tileX == idealRestX)
56060 {
56061 return tileY == idealRestY;
56062 }
56063 return false;
56064 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990

References Terraria.NPC.ai, Terraria.Main.dayTime, Terraria.NPC.type, and Terraria.Entity.wet.

Referenced by Terraria.NPC.AI_007_TownEntities().

+ Here is the caller graph for this function: