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

◆ CanHit()

bool Terraria.Player.CanHit ( Entity ent)
inline

Definition at line 40596 of file Player.cs.

40597 {
40598 if (!Collision.CanHit(position, width, height, ent.position, ent.width, ent.height) && !Collision.CanHitLine(base.Center + new Vector2(direction * width / 2, gravDir * (float)(-height) / 3f), 0, 0, ent.Center + new Vector2(0f, -ent.height / 3), 0, 0) && !Collision.CanHitLine(base.Center + new Vector2(direction * width / 2, gravDir * (float)(-height) / 3f), 0, 0, ent.Center, 0, 0))
40599 {
40600 return Collision.CanHitLine(base.Center + new Vector2(direction * width / 2, 0f), 0, 0, ent.Center + new Vector2(0f, ent.height / 3), 0, 0);
40601 }
40602 return true;
40603 }
Vector2 position
Definition Entity.cs:14

References Terraria.Collision.CanHit(), and Terraria.Collision.CanHitLine().