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

◆ CutTilesAt()

void Terraria.Projectile.CutTilesAt ( Vector2 boxPosition,
int boxWidth,
int boxHeight )
inlineprivate

Definition at line 14178 of file Projectile.cs.

14179 {
14180 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
14181 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
14182 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
14183 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
14184 int num = (int)(boxPosition.X / 16f);
14185 int num2 = (int)((boxPosition.X + (float)boxWidth) / 16f) + 1;
14186 int num3 = (int)(boxPosition.Y / 16f);
14187 int num4 = (int)((boxPosition.Y + (float)boxHeight) / 16f) + 1;
14188 if (num < 0)
14189 {
14190 num = 0;
14191 }
14192 if (num2 > Main.maxTilesX)
14193 {
14194 num2 = Main.maxTilesX;
14195 }
14196 if (num3 < 0)
14197 {
14198 num3 = 0;
14199 }
14200 if (num4 > Main.maxTilesY)
14201 {
14202 num4 = Main.maxTilesY;
14203 }
14204 bool[] tileCutIgnorance = Main.player[owner].GetTileCutIgnorance(allowRegrowth: false, trap);
14205 for (int i = num; i < num2; i++)
14206 {
14207 for (int j = num3; j < num4; j++)
14208 {
14209 if (Main.tile[i, j] != null && Main.tileCut[Main.tile[i, j].type] && !tileCutIgnorance[Main.tile[i, j].type] && WorldGen.CanCutTile(i, j, TileCuttingContext.AttackProjectile))
14210 {
14211 WorldGen.KillTile(i, j);
14212 if (Main.netMode != 0)
14213 {
14214 NetMessage.SendData(17, -1, -1, null, 0, i, j);
14215 }
14216 }
14217 }
14218 }
14220 }
static void CutTiles(Projectile projectile)
This serves as the central class from which projectile-related functions are carried out....
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
bool trap
If true, this projectile was spawned by a trap tile.

References Terraria.WorldGen.CanCutTile(), Terraria.ModLoader.ProjectileLoader.CutTiles(), Terraria.WorldGen.KillTile(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.Projectile.owner, Terraria.Main.player, Terraria.NetMessage.SendData(), Terraria.Main.tile, Terraria.Main.tileCut, and Terraria.Projectile.trap.

Referenced by Terraria.Projectile.CutTiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: