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

◆ IsTileTypeInInteractionRange()

bool Terraria.Player.IsTileTypeInInteractionRange ( int targetTileType,
TileReachCheckSettings settings )
inline

Definition at line 34575 of file Player.cs.

34576 {
34577 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
34578 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
34579 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
34580 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
34581 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
34582 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
34583 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
34584 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
34585 Point val = position.ToTileCoordinates();
34586 Point point2 = base.BottomRight.ToTileCoordinates();
34587 settings.GetRanges(this, out var x, out var y);
34588 int num = Utils.Clamp(val.X - x + 1, 0, Main.maxTilesX - 1);
34589 int num2 = Utils.Clamp(point2.X + x - 1, 0, Main.maxTilesX - 1);
34590 int num3 = Utils.Clamp(val.Y - y + 1, 0, Main.maxTilesY - 1);
34591 int num4 = Utils.Clamp(point2.Y + y - 2, 0, Main.maxTilesY - 1);
34592 for (int i = num; i <= num2; i++)
34593 {
34594 for (int j = num3; j <= num4; j++)
34595 {
34596 Tile tile = Main.tile[i, j];
34597 if (tile != null && tile.active() && tile.type == targetTileType)
34598 {
34599 return true;
34600 }
34601 }
34602 }
34603 return false;
34604 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28

References Terraria.Tile.active(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Entity.position, Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.GameContent.TeleportPylonsSystem.IsPlayerNearAPylon().

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