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

◆ ClearBrokenTraps()

static void Terraria.WorldGen.ClearBrokenTraps ( Point startTileCoords,
List< Point > pointsWeAlreadyWentOver )
inlinestatic

Definition at line 19565 of file WorldGen.cs.

19566 {
19567 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
19568 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
19569 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
19570 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
19571 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
19572 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
19573 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
19574 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
19575 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
19576 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
19577 //IL_018d: Unknown result type (might be due to invalid IL or missing references)
19578 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
19579 //IL_019b: Unknown result type (might be due to invalid IL or missing references)
19580 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
19581 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
19582 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
19583 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
19584 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
19585 //IL_022e: Unknown result type (might be due to invalid IL or missing references)
19586 //IL_0235: Unknown result type (might be due to invalid IL or missing references)
19587 //IL_01f3: Unknown result type (might be due to invalid IL or missing references)
19588 //IL_01fa: Unknown result type (might be due to invalid IL or missing references)
19589 //IL_00db: Unknown result type (might be due to invalid IL or missing references)
19590 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
19591 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
19592 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
19593 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
19594 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
19595 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
19596 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
19597 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
19598 //IL_0134: Unknown result type (might be due to invalid IL or missing references)
19599 //IL_0143: Unknown result type (might be due to invalid IL or missing references)
19600 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
19601 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
19602 List<Point> t = new List<Point>();
19603 List<Point> t2 = new List<Point>();
19604 List<Point> list = new List<Point>();
19605 bool flag = false;
19606 bool flag2 = false;
19607 t2.Add(startTileCoords);
19608 Point item2 = default(Point);
19609 while (t2.Count > 0)
19610 {
19611 Utils.Swap(ref t, ref t2);
19612 while (t.Count > 0)
19613 {
19614 Point item = t[0];
19615 t.RemoveAt(0);
19616 if (!InWorld(item.X, item.Y, 5))
19617 {
19618 continue;
19619 }
19620 Tile tile = Main.tile[item.X, item.Y];
19621 if (tile.wire())
19622 {
19623 pointsWeAlreadyWentOver.Add(item);
19624 list.Add(item);
19625 if (IsItATrap(tile))
19626 {
19627 flag = true;
19628 }
19629 if (IsItATrigger(tile))
19630 {
19631 flag2 = true;
19632 }
19633 if (flag2 && flag)
19634 {
19635 break;
19636 }
19637 ((Point)(ref item2))._002Ector(item.X - 1, item.Y);
19638 if (!list.Contains(item2))
19639 {
19640 t2.Add(item2);
19641 }
19642 ((Point)(ref item2))._002Ector(item.X + 1, item.Y);
19643 if (!list.Contains(item2))
19644 {
19645 t2.Add(item2);
19646 }
19647 ((Point)(ref item2))._002Ector(item.X, item.Y - 1);
19648 if (!list.Contains(item2))
19649 {
19650 t2.Add(item2);
19651 }
19652 ((Point)(ref item2))._002Ector(item.X, item.Y + 1);
19653 if (!list.Contains(item2))
19654 {
19655 t2.Add(item2);
19656 }
19657 }
19658 }
19659 if (flag2 && flag)
19660 {
19661 break;
19662 }
19663 }
19664 if (flag2 && flag)
19665 {
19666 return;
19667 }
19668 foreach (Point item3 in list)
19669 {
19670 Tile tile2 = Main.tile[item3.X, item3.Y];
19671 tile2.wire(wire: false);
19672 if (IsItATrap(tile2))
19673 {
19674 if (tile2.actuator())
19675 {
19676 Main.tile[item3.X, item3.Y].actuator(actuator: false);
19677 }
19678 else if (tile2.type != 105)
19679 {
19680 KillTile(item3.X, item3.Y);
19681 }
19682 }
19683 else if (IsItATrigger(tile2))
19684 {
19685 if (tile2.type == 314)
19686 {
19687 tile2.frameX = 1;
19688 }
19689 else
19690 {
19691 KillTile(item3.X, item3.Y);
19692 }
19693 }
19694 }
19695 }
static bool IsItATrap(Tile tile)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static bool IsItATrigger(Tile tile)
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:6481

References Terraria.Main.tile, and Terraria.Tile.wire().

+ Here is the call graph for this function: