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

◆ EmptyTileCheck()

static bool Terraria.WorldGen.EmptyTileCheck ( int startX,
int endX,
int startY,
int endY,
int ignoreID = -1 )
inlinestatic

Definition at line 23284 of file WorldGen.cs.

23285 {
23286 if (startX < 0)
23287 {
23288 return false;
23289 }
23290 if (endX >= Main.maxTilesX)
23291 {
23292 return false;
23293 }
23294 if (startY < 0)
23295 {
23296 return false;
23297 }
23298 if (endY >= Main.maxTilesY)
23299 {
23300 return false;
23301 }
23302 bool flag = false;
23304 {
23305 flag = true;
23306 }
23307 for (int i = startX; i < endX + 1; i++)
23308 {
23309 for (int j = startY; j < endY + 1; j++)
23310 {
23311 if (!Main.tile[i, j].active())
23312 {
23313 continue;
23314 }
23315 switch (ignoreID)
23316 {
23317 case -1:
23318 return false;
23319 case 11:
23320 {
23321 ushort type = Main.tile[i, j].type;
23322 if (type == 11)
23323 {
23324 continue;
23325 }
23326 return false;
23327 }
23328 case 71:
23329 {
23330 ushort type = Main.tile[i, j].type;
23331 if (type == 71)
23332 {
23333 continue;
23334 }
23335 return false;
23336 }
23337 }
23338 if (flag)
23339 {
23340 if (TileID.Sets.CommonSapling[Main.tile[i, j].type])
23341 {
23342 break;
23343 }
23344 switch (Main.tile[i, j].type)
23345 {
23346 case 3:
23347 case 24:
23348 case 32:
23349 case 61:
23350 case 62:
23351 case 69:
23352 case 71:
23353 case 73:
23354 case 74:
23355 case 82:
23356 case 83:
23357 case 84:
23358 case 110:
23359 case 113:
23360 case 184:
23361 case 201:
23362 case 233:
23363 case 352:
23364 case 485:
23365 case 529:
23366 case 530:
23367 case 637:
23368 case 655:
23369 continue;
23370 }
23371 return false;
23372 }
23373 }
23374 }
23375 return true;
23376 }
static bool[] CommonSapling
Definition TileID.cs:103

References Terraria.ID.TileID.Sets.CommonSapling, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.tile, and System.type.

Referenced by Terraria.GameContent.SmartCursorHelper.Step_Acorns(), and Terraria.GameContent.SmartCursorHelper.Step_GemCorns().