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

◆ IsGolfShotValid()

static bool Terraria.GameContent.Golf.GolfHelper.IsGolfShotValid ( Entity golfBall,
Player player )
inlinestatic

Definition at line 426 of file GolfHelper.cs.

427 {
428 Vector2 vector = golfBall.Center - player.Bottom;
429 if (player.direction == -1)
430 {
431 vector.X *= -1f;
432 }
433 if (vector.X >= -16f && vector.X <= 32f && vector.Y <= 16f)
434 {
435 return vector.Y >= -16f;
436 }
437 return false;
438 }

References Terraria.Entity.Bottom, Terraria.Entity.direction, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.

Referenced by Terraria.Main.DrawProjDirect().