Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ IsInInteractionRangeToMultiTileHitbox()

bool Terraria.Player.IsInInteractionRangeToMultiTileHitbox ( int chestPointX,
int chestPointY )
inline

Definition at line 28858 of file Player.cs.

28859 {
28860 int num = (int)(((double)position.X + (double)width * 0.5) / 16.0);
28861 int num2 = (int)(((double)position.Y + (double)height * 0.5) / 16.0);
28863 Tile tile = Main.tile[chestPointX, chestPointY];
28864 if (tile.type == 463 || tile.type == 491)
28865 {
28866 r = new Rectangle(chestPointX * 16 - 16, chestPointY * 16 - 32, 48, 64);
28867 }
28868 if (TileID.Sets.BasicChest[tile.type] || tile.type == 97)
28869 {
28870 r = new Rectangle(chestPointX * 16, chestPointY * 16, 32, 32);
28871 }
28872 if (tile.type == 88)
28873 {
28874 r = new Rectangle(chestPointX * 16, chestPointY * 16, 48, 32);
28875 }
28876 if (tile.type == 29)
28877 {
28878 r = new Rectangle(chestPointX * 16, chestPointY * 16, 32, 16);
28879 }
28880 r.Inflate(-1, -1);
28881 Point point = r.ClosestPointInRect(base.Center).ToTileCoordinates();
28882 chestPointX = point.X;
28883 chestPointY = point.Y;
28885 }
Vector2 position
Definition Entity.cs:14
static bool[] BasicChest
Definition TileID.cs:223
static int tileRangeX
Definition Player.cs:2075
static int tileRangeY
Definition Player.cs:2077

References Terraria.ID.TileID.Sets.BasicChest, Microsoft.Xna.Framework.Rectangle.Empty, Terraria.Main.tile, Terraria.Tile.type, Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.