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

◆ GetNearbyResidentNPCs()

List< NPC > Terraria.GameContent.ShopHelper.GetNearbyResidentNPCs ( NPC npc,
out int npcsWithinHouse,
out int npcsWithinVillage )
inlineprivate

Definition at line 291 of file ShopHelper.cs.

292 {
293 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
294 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
295 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
296 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
297 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
298 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
299 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
300 List<NPC> list = new List<NPC>();
301 npcsWithinHouse = 0;
303 Vector2 value = default(Vector2);
304 ((Vector2)(ref value))._002Ector((float)npc.homeTileX, (float)npc.homeTileY);
305 if (npc.homeless)
306 {
307 ((Vector2)(ref value))._002Ector(npc.Center.X / 16f, npc.Center.Y / 16f);
308 }
309 Vector2 value2 = default(Vector2);
310 for (int i = 0; i < 200; i++)
311 {
312 if (i == npc.whoAmI)
313 {
314 continue;
315 }
316 NPC nPC = Main.npc[i];
317 if (nPC.active && nPC.townNPC && !IsNotReallyTownNPC(nPC) && !WorldGen.TownManager.CanNPCsLiveWithEachOther_ShopHelper(npc, nPC))
318 {
319 ((Vector2)(ref value2))._002Ector((float)nPC.homeTileX, (float)nPC.homeTileY);
320 if (nPC.homeless)
321 {
322 value2 = nPC.Center / 16f;
323 }
324 float num = Vector2.Distance(value, value2);
325 if (num < 25f)
326 {
327 list.Add(nPC);
329 }
330 else if (num < 120f)
331 {
333 }
334 }
335 }
336 return list;
337 }

References Terraria.Entity.Center, Terraria.NPC.homeless, Terraria.NPC.homeTileX, Terraria.NPC.homeTileY, Terraria.GameContent.ShopHelper.IsNotReallyTownNPC(), Terraria.Main.npc, Terraria.WorldGen.TownManager, and Terraria.Entity.whoAmI.

Referenced by Terraria.GameContent.ShopHelper.ProcessMood().

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