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

◆ ShouldWallExplode()

bool Terraria.Projectile.ShouldWallExplode ( Vector2 compareSpot,
int radius,
int minI,
int maxI,
int minJ,
int maxJ )
inline

Determines if walls should be exploded by checking if there is an empty wall within the specified radius and bounds. Use in conjunction with M:Terraria.Projectile.ExplodeTiles(Microsoft.Xna.Framework.Vector2,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Boolean).

Definition at line 91692 of file Projectile.cs.

91693 {
91694 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
91695 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
91696 bool result = false;
91697 for (int i = minI; i <= maxI; i++)
91698 {
91699 for (int j = minJ; j <= maxJ; j++)
91700 {
91701 float num3 = Math.Abs((float)i - compareSpot.X / 16f);
91702 float num2 = Math.Abs((float)j - compareSpot.Y / 16f);
91703 if (Math.Sqrt(num3 * num3 + num2 * num2) < (double)radius && Main.tile[i, j] != null && Main.tile[i, j].wall == 0)
91704 {
91705 result = true;
91706 break;
91707 }
91708 }
91709 }
91710 return result;
91711 }

References Terraria.Main.tile.