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

◆ SolidTiles() [2/4]

static bool Terraria.Collision.SolidTiles ( int startX,
int endX,
int startY,
int endY,
bool allowTopSurfaces )
inlinestatic

Definition at line 2992 of file Collision.cs.

2993 {
2994 if (startX < 0)
2995 {
2996 return true;
2997 }
2998 if (endX >= Main.maxTilesX)
2999 {
3000 return true;
3001 }
3002 if (startY < 0)
3003 {
3004 return true;
3005 }
3006 if (endY >= Main.maxTilesY)
3007 {
3008 return true;
3009 }
3010 for (int i = startX; i < endX + 1; i++)
3011 {
3012 for (int j = startY; j < endY + 1; j++)
3013 {
3014 Tile tile = Main.tile[i, j];
3015 if (tile == null)
3016 {
3017 return false;
3018 }
3019 if (tile.active() && !Main.tile[i, j].inActive())
3020 {
3021 ushort type = tile.type;
3022 bool flag = Main.tileSolid[type] && !Main.tileSolidTop[type];
3023 if (allowTopSurfaces)
3024 {
3025 flag |= Main.tileSolidTop[type] && tile.frameY == 0;
3026 }
3027 if (flag)
3028 {
3029 return true;
3030 }
3031 }
3032 }
3033 }
3034 return false;
3035 }

References Terraria.Tile.active(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, System.type, and Terraria.Tile.type.