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

◆ IsInRangeOfMeOrMyOwner()

bool Terraria.Projectile.IsInRangeOfMeOrMyOwner ( Entity entity,
float maxDistance,
out float myDistance,
out float playerDistance,
out bool closerIsMe )
inline

Definition at line 54047 of file Projectile.cs.

54048 {
54049 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
54050 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
54051 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
54052 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
54053 myDistance = Vector2.Distance(entity.Center, base.Center);
54054 if (myDistance < maxDistance && !CanHitWithOwnBody(entity))
54055 {
54056 myDistance = float.PositiveInfinity;
54057 }
54058 playerDistance = Vector2.Distance(entity.Center, Main.player[owner].Center);
54060 {
54061 playerDistance = float.PositiveInfinity;
54062 }
54064 if (closerIsMe)
54065 {
54066 return myDistance <= maxDistance;
54067 }
54068 return playerDistance <= maxDistance;
54069 }
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
bool CanHitWithOwnBody(Entity ent)
bool CanHitWithMeleeWeapon(Entity ent)

References Terraria.Entity.Center, and Terraria.Main.player.