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

◆ ItemCheck_UseMiningTools_TryFindingWallToHammer()

static void Terraria.Player.ItemCheck_UseMiningTools_TryFindingWallToHammer ( out int wX,
out int wY )
inlinestaticprivate

Definition at line 45560 of file Player.cs.

45561 {
45562 wX = tileTargetX;
45563 wY = tileTargetY;
45564 bool flag = true;
45565 if (Main.tile[wX, wY].wall > 0)
45566 {
45567 if (!Main.wallHouse[Main.tile[wX, wY].wall])
45568 {
45569 for (int i = wX - 1; i < wX + 2; i++)
45570 {
45571 for (int j = wY - 1; j < wY + 2; j++)
45572 {
45573 if (Main.tile[i, j].wall != Main.tile[wX, wY].wall)
45574 {
45575 flag = false;
45576 break;
45577 }
45578 }
45579 }
45580 }
45581 else
45582 {
45583 flag = false;
45584 }
45585 }
45586 if (!flag || Main.tile[wX, wY].active())
45587 {
45588 return;
45589 }
45590 int num = -1;
45591 if ((double)(((float)Main.mouseX + Main.screenPosition.X) / 16f) < Math.Round(((float)Main.mouseX + Main.screenPosition.X) / 16f))
45592 {
45593 num = 0;
45594 }
45595 int num2 = -1;
45596 if ((double)(((float)Main.mouseY + Main.screenPosition.Y) / 16f) < Math.Round(((float)Main.mouseY + Main.screenPosition.Y) / 16f))
45597 {
45598 num2 = 0;
45599 }
45600 for (int k = tileTargetX + num; k <= tileTargetX + num + 1; k++)
45601 {
45602 for (int l = tileTargetY + num2; l <= tileTargetY + num2 + 1; l++)
45603 {
45604 if (!flag)
45605 {
45606 continue;
45607 }
45608 wX = k;
45609 wY = l;
45610 if (Main.tile[wX, wY].wall <= 0)
45611 {
45612 continue;
45613 }
45614 if (!Main.wallHouse[Main.tile[wX, wY].wall])
45615 {
45616 for (int m = wX - 1; m < wX + 2; m++)
45617 {
45618 for (int n = wY - 1; n < wY + 2; n++)
45619 {
45620 if (Main.tile[m, n].wall != Main.tile[wX, wY].wall)
45621 {
45622 flag = false;
45623 break;
45624 }
45625 }
45626 }
45627 }
45628 else
45629 {
45630 flag = false;
45631 }
45632 }
45633 }
45634 }
static int tileTargetY
Definition Player.cs:2652
static int tileTargetX
Definition Player.cs:2650

References Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.screenPosition, Terraria.Main.tile, Terraria.Player.tileTargetX, Terraria.Player.tileTargetY, and Terraria.Main.wallHouse.

Referenced by Terraria.Player.ItemCheck_UseMiningTools().

+ Here is the caller graph for this function: