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

◆ SwitchMB()

static void Terraria.WorldGen.SwitchMB ( int i,
int j )
inlinestatic

Definition at line 44612 of file WorldGen.cs.

44613 {
44614 int num = i;
44615 int num2 = j;
44616 Tile tile = Main.tile[i, j];
44617 int num3;
44618 for (num3 = tile.frameY / 18; num3 >= 2; num3 -= 2)
44619 {
44620 }
44621 tile = Main.tile[i, j];
44622 int num4 = tile.frameX / 18;
44623 if (num4 >= 2)
44624 {
44625 num4 -= 2;
44626 }
44627 num = i - num4;
44628 num2 = j - num3;
44629 for (int k = num; k < num + 2; k++)
44630 {
44631 for (int l = num2; l < num2 + 2; l++)
44632 {
44633 if (Main.tile[k, l] == null)
44634 {
44635 tile = (Main.tile[k, l] = default(Tile));
44636 }
44637 tile = Main.tile[k, l];
44638 if (!tile.active())
44639 {
44640 continue;
44641 }
44642 tile = Main.tile[k, l];
44643 if (tile.type != 139)
44644 {
44645 tile = Main.tile[k, l];
44646 if (tile.type != 35 && !TileLoader.IsModMusicBox(Main.tile[k, l]))
44647 {
44648 continue;
44649 }
44650 }
44651 tile = Main.tile[k, l];
44652 if (tile.frameX < 36)
44653 {
44654 tile = Main.tile[k, l];
44655 tile.frameX += 36;
44656 }
44657 else
44658 {
44659 tile = Main.tile[k, l];
44660 tile.frameX -= 36;
44661 }
44662 }
44663 }
44664 if (Wiring.running)
44665 {
44666 Wiring.SkipWire(num, num2);
44667 Wiring.SkipWire(num + 1, num2);
44668 Wiring.SkipWire(num, num2 + 1);
44669 Wiring.SkipWire(num + 1, num2 + 1);
44670 }
44671 NetMessage.SendTileSquare(-1, num, num2, 2, 2);
44672 }
static bool IsModMusicBox(Tile tile)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23

References Terraria.Tile.active(), Terraria.Tile.frameX, Terraria.Tile.frameY, Terraria.ModLoader.TileLoader.IsModMusicBox(), Terraria.Wiring.running, Terraria.NetMessage.SendTileSquare(), Terraria.Wiring.SkipWire(), Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.Player.TileInteractionsUse().

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