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

◆ ProvideCandidate()

bool Terraria.GameContent.ObjectInteractions.ProjectileSmartInteractCandidateProvider.ProvideCandidate ( SmartInteractScanSettings settings,
out ISmartInteractCandidate candidate )
inline

Implements Terraria.GameContent.ObjectInteractions.ISmartInteractCandidateProvider.

Definition at line 34 of file ProjectileSmartInteractCandidateProvider.cs.

35 {
36 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
37 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
38 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
39 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
40 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
41 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
42 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
43 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
44 candidate = null;
45 if (!settings.FullInteraction)
46 {
47 return false;
48 }
49 List<int> listOfProjectilesToInteractWithHack = settings.player.GetListOfProjectilesToInteractWithHack();
50 bool flag = false;
51 Vector2 mousevec = settings.mousevec;
52 mousevec.ToPoint();
53 int num = -1;
55 for (int i = 0; i < listOfProjectilesToInteractWithHack.Count; i++)
56 {
58 Projectile projectile = Main.projectile[num2];
59 if (projectile.active)
60 {
61 float num3 = projectile.Hitbox.Distance(mousevec);
62 if (num == -1 || Main.projectile[num].Hitbox.Distance(mousevec) > num3)
63 {
64 num = num2;
66 }
67 if (num3 == 0f)
68 {
69 flag = true;
70 num = num2;
72 break;
73 }
74 }
75 }
76 if (settings.DemandOnlyZeroDistanceTargets && !flag)
77 {
78 return false;
79 }
80 if (num != -1)
81 {
84 return true;
85 }
86 return false;
87 }

References Terraria.GameContent.ObjectInteractions.ProjectileSmartInteractCandidateProvider._candidate, Terraria.Entity.active, Terraria.Entity.Hitbox, Terraria.Main.projectile, and Terraria.GameContent.ObjectInteractions.ProjectileSmartInteractCandidateProvider.ReusableCandidate.Reuse().

+ Here is the call graph for this function: