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

◆ Framing_CheckTile()

static void Terraria.GameContent.Tile_Entities.TEWeaponsRack.Framing_CheckTile ( int callX,
int callY )
inlinestatic

Definition at line 124 of file TEWeaponsRack.cs.

125 {
126 int num = 3;
127 int num2 = 3;
128 if (WorldGen.destroyObject)
129 {
130 return;
131 }
132 int num3 = callX;
133 int num4 = callY;
134 Tile tileSafely = Framing.GetTileSafely(callX, callY);
135 num3 -= tileSafely.frameX / 18 % num;
136 num4 -= tileSafely.frameY / 18 % num2;
137 bool flag = false;
138 for (int i = num3; i < num3 + num; i++)
139 {
140 for (int j = num4; j < num4 + num2; j++)
141 {
142 Tile tile = Main.tile[i, j];
143 if (!tile.active() || tile.type != 471 || tile.wall == 0)
144 {
145 flag = true;
146 }
147 }
148 }
149 if (!flag)
150 {
151 return;
152 }
153 int num5 = Find(num3, num4);
154 if (num5 != -1 && ((TEWeaponsRack)TileEntity.ByID[num5]).item.stack > 0)
155 {
156 ((TEWeaponsRack)TileEntity.ByID[num5]).DropItem();
157 if (Main.netMode != 2)
158 {
159 Main.LocalPlayer.InterruptItemUsageIfOverTile(471);
160 }
161 }
162 WorldGen.destroyObject = true;
163 bool drop = TileLoader.Drop(callX, callY, 471);
164 for (int k = num3; k < num3 + num; k++)
165 {
166 for (int l = num4; l < num4 + num2; l++)
167 {
168 if (Main.tile[k, l].active() && Main.tile[k, l].type == 471)
169 {
170 WorldGen.KillTile(k, l);
171 }
172 }
173 }
174 if (drop)
175 {
176 Item.NewItem(new EntitySource_TileBreak(num3, num4), num3 * 16, num4 * 16, 48, 48, 2699);
177 }
178 Kill(num3, num4);
179 WorldGen.destroyObject = false;
180 }
static Dictionary< int, TileEntity > ByID
Definition TileEntity.cs:20
static bool Drop(int i, int j, int type, bool includeLargeObjectDrops=true)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23

References Terraria.GameContent.Tile_Entities.TEWeaponsRack.TEWeaponsRack(), Terraria.Tile.active(), Terraria.DataStructures.TileEntity.ByID, Terraria.WorldGen.destroyObject, Terraria.ModLoader.TileLoader.Drop(), Terraria.GameContent.Tile_Entities.TEWeaponsRack.Find(), Terraria.Framing.GetTileSafely(), Terraria.GameContent.Tile_Entities.TEWeaponsRack.Kill(), Terraria.WorldGen.KillTile(), Terraria.Main.LocalPlayer, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Main.tile, Terraria.Tile.type, and Terraria.Tile.wall.

Referenced by Terraria.WorldGen.TileFrame().

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