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

◆ CanHit()

bool Terraria.Player.CanHit ( Entity ent)
inline

Definition at line 41725 of file Player.cs.

41726 {
41727 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
41728 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
41729 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
41730 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
41731 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
41732 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
41733 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
41734 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
41735 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
41736 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
41737 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
41738 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
41739 //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
41740 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
41741 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
41742 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
41743 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
41744 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
41745 if (!Collision.CanHit(position, width, height, ent.position, ent.width, ent.height) && !Collision.CanHitLine(base.Center + new Vector2((float)(direction * width / 2), gravDir * (float)(-height) / 3f), 0, 0, ent.Center + new Vector2(0f, (float)(-ent.height / 3)), 0, 0) && !Collision.CanHitLine(base.Center + new Vector2((float)(direction * width / 2), gravDir * (float)(-height) / 3f), 0, 0, ent.Center, 0, 0))
41746 {
41747 return Collision.CanHitLine(base.Center + new Vector2((float)(direction * width / 2), 0f), 0, 0, ent.Center + new Vector2(0f, (float)(ent.height / 3)), 0, 0);
41748 }
41749 return true;
41750 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51

References Terraria.Collision.CanHit(), Terraria.Collision.CanHitLine(), Terraria.Entity.direction, Terraria.Player.gravDir, Terraria.Entity.height, Terraria.Entity.position, and Terraria.Entity.width.

Referenced by Terraria.Player.DashMovement(), Terraria.Player.ItemCheck_MeleeHitPVP(), and Terraria.Player.ProcessHitAgainstNPC().

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