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

◆ IsLocationInvalid()

static bool Terraria.GameContent.Generation.TrackGenerator.IsLocationInvalid ( int x,
int y )
inlinestaticprivate

Definition at line 429 of file TrackGenerator.cs.

430 {
431 if (y > Main.UnderworldLayer || x < 5 || y < (int)Main.worldSurface || x > Main.maxTilesX - 5)
432 {
433 return true;
434 }
435 if (Math.Abs((double)x - GenVars.shimmerPosition.X) < (double)(WorldGen.shimmerSafetyDistance / 2) && Math.Abs((double)y - GenVars.shimmerPosition.Y) < (double)(WorldGen.shimmerSafetyDistance / 2))
436 {
437 return true;
438 }
439 if (WorldGen.oceanDepths(x, y))
440 {
441 return true;
442 }
443 ushort wall = Main.tile[x, y].wall;
444 for (int i = 0; i < InvalidWalls.Length; i++)
445 {
446 if (wall == InvalidWalls[i] && (!WorldGen.notTheBees || wall != 108))
447 {
448 return true;
449 }
450 }
451 ushort type = Main.tile[x, y].type;
452 for (int j = 0; j < InvalidTiles.Length; j++)
453 {
454 if (type == InvalidTiles[j])
455 {
456 return true;
457 }
458 }
459 for (int k = -1; k <= 1; k++)
460 {
461 if (Main.tile[x + k, y].active() && (Main.tile[x + k, y].type == 314 || !TileID.Sets.GeneralPlacementTiles[Main.tile[x + k, y].type]) && (!WorldGen.notTheBees || Main.tile[x + k, y].type != 225))
462 {
463 return true;
464 }
465 }
466 return false;
467 }
static double Abs(double value)
static bool[] GeneralPlacementTiles
Definition TileID.cs:221
static Vector2D shimmerPosition
Definition GenVars.cs:310

References System.Math.Abs(), Terraria.ID.TileID.Sets.GeneralPlacementTiles, Terraria.GameContent.Generation.TrackGenerator.InvalidTiles, Terraria.GameContent.Generation.TrackGenerator.InvalidWalls, Terraria.Main.maxTilesX, Terraria.WorldGen.notTheBees, Terraria.WorldGen.oceanDepths(), Terraria.WorldBuilding.GenVars.shimmerPosition, Terraria.WorldGen.shimmerSafetyDistance, Terraria.Main.tile, System.type, Terraria.Main.UnderworldLayer, and Terraria.Main.worldSurface.

Referenced by Terraria.GameContent.Generation.TrackGenerator.CalculateStateForLocation().