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

◆ Framing_CheckTile()

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

Definition at line 171 of file TEHatRack.cs.

172 {
173 if (WorldGen.destroyObject)
174 {
175 return;
176 }
177 int num = callX;
178 int num2 = callY;
179 Tile tileSafely = Framing.GetTileSafely(callX, callY);
180 num -= tileSafely.frameX / 18 % 3;
181 num2 -= tileSafely.frameY / 18 % 4;
182 bool flag = false;
183 for (int i = num; i < num + 3; i++)
184 {
185 for (int j = num2; j < num2 + 4; j++)
186 {
187 Tile tile = Main.tile[i, j];
188 if (!tile.active() || tile.type != 475)
189 {
190 flag = true;
191 }
192 }
193 }
194 if (!WorldGen.SolidTileAllowBottomSlope(num, num2 + 4) || !WorldGen.SolidTileAllowBottomSlope(num + 1, num2 + 4) || !WorldGen.SolidTileAllowBottomSlope(num + 2, num2 + 4))
195 {
196 flag = true;
197 }
198 if (!flag)
199 {
200 return;
201 }
202 Kill(num, num2);
203 Item.NewItem(new EntitySource_TileBreak(num, num2), num * 16, num2 * 16, 48, 64, 3977);
204 WorldGen.destroyObject = true;
205 for (int k = num; k < num + 3; k++)
206 {
207 for (int l = num2; l < num2 + 4; l++)
208 {
209 if (Main.tile[k, l].active() && Main.tile[k, l].type == 475)
210 {
211 WorldGen.KillTile(k, l);
212 }
213 }
214 }
215 WorldGen.destroyObject = false;
216 }

References Terraria.Tile.active(), Terraria.WorldGen.destroyObject, Terraria.Framing.GetTileSafely(), Terraria.GameContent.Tile_Entities.TEHatRack.Kill(), Terraria.WorldGen.KillTile(), Terraria.Item.NewItem(), Terraria.WorldGen.SolidTileAllowBottomSlope(), Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.WorldGen.TileFrame().