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

◆ ScanWorldForFinds()

void Terraria.GameContent.Bestiary.NPCWasNearPlayerTracker.ScanWorldForFinds ( )
inline

Definition at line 102 of file NPCWasNearPlayerTracker.cs.

103 {
105 for (int i = 0; i < 255; i++)
106 {
107 Player player = Main.player[i];
108 if (player.active)
109 {
110 _playerHitboxesForBestiary.Add(player.HitboxForBestiaryNearbyCheck);
111 }
112 }
113 for (int j = 0; j < 200; j++)
114 {
115 NPC nPC = Main.npc[j];
116 if (!nPC.active || !nPC.CountsAsACritter || _wasSeenNearPlayerByNetId.Contains(nPC.netID))
117 {
118 continue;
119 }
120 Rectangle hitbox = nPC.Hitbox;
121 for (int k = 0; k < _playerHitboxesForBestiary.Count; k++)
122 {
124 if (hitbox.Intersects(value))
125 {
128 }
129 }
130 }
131 }

References Terraria.GameContent.Bestiary.NPCWasNearPlayerTracker._playerHitboxesForBestiary, Terraria.GameContent.Bestiary.NPCWasNearPlayerTracker._wasSeenNearPlayerByNetId, Terraria.Entity.active, System.Collections.Generic.List< T >.Add(), System.Collections.Generic.List< T >.Clear(), System.Collections.Generic.List< T >.Contains(), System.Collections.Generic.List< T >.Count, Terraria.Player.HitboxForBestiaryNearbyCheck, Terraria.Main.npc, Terraria.Main.player, and Terraria.GameContent.Bestiary.NPCWasNearPlayerTracker.RegisterWasNearby().