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

◆ Framing_CheckTile()

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

Definition at line 186 of file TEDisplayDoll.cs.

187 {
188 if (WorldGen.destroyObject)
189 {
190 return;
191 }
192 int num = callX;
193 int num2 = callY;
194 Tile tileSafely = Framing.GetTileSafely(callX, callY);
195 num -= tileSafely.frameX / 18 % 2;
196 num2 -= tileSafely.frameY / 18 % 3;
197 bool flag = false;
198 for (int i = num; i < num + 2; i++)
199 {
200 for (int j = num2; j < num2 + 3; j++)
201 {
202 Tile tile = Main.tile[i, j];
203 if (!tile.active() || tile.type != 470)
204 {
205 flag = true;
206 }
207 }
208 }
209 if (!WorldGen.SolidTileAllowBottomSlope(num, num2 + 3) || !WorldGen.SolidTileAllowBottomSlope(num + 1, num2 + 3))
210 {
211 flag = true;
212 }
213 if (!flag)
214 {
215 return;
216 }
217 Kill(num, num2);
218 if (Main.tile[callX, callY].frameX / 72 != 1)
219 {
220 Item.NewItem(new EntitySource_TileBreak(num, num2), num * 16, num2 * 16, 32, 48, 498);
221 }
222 else
223 {
224 Item.NewItem(new EntitySource_TileBreak(num, num2), num * 16, num2 * 16, 32, 48, 1989);
225 }
226 WorldGen.destroyObject = true;
227 for (int k = num; k < num + 2; k++)
228 {
229 for (int l = num2; l < num2 + 3; l++)
230 {
231 if (Main.tile[k, l].active() && Main.tile[k, l].type == 470)
232 {
233 WorldGen.KillTile(k, l);
234 }
235 }
236 }
237 WorldGen.destroyObject = false;
238 }

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

Referenced by Terraria.WorldGen.TileFrame().