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

◆ SpawnFallingBlockProjectile()

static bool Terraria.WorldGen.SpawnFallingBlockProjectile ( int i,
int j,
Tile tileCache,
Tile tileTopCache,
Tile tileBottomCache,
int type )
inlinestaticprivate

Definition at line 79768 of file WorldGen.cs.

79769 {
79770 //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
79771 //IL_0205: Unknown result type (might be due to invalid IL or missing references)
79772 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
79773 if (Main.netMode == 1)
79774 {
79775 return false;
79776 }
79777 if (tileCache == null || tileTopCache == null || tileBottomCache == null)
79778 {
79779 return false;
79780 }
79781 if (!BlockBelowMakesSandFall(i, j))
79782 {
79783 return false;
79784 }
79786 {
79787 return false;
79788 }
79790 tileCache.ClearTile();
79791 if (Main.netMode == 0)
79792 {
79793 int num = Projectile.NewProjectile(GetProjectileSource_TileBreak(i, j), i * 16 + 8, j * 16 + 8, 0f, 0.41f, projType, dmg, 0f, Main.myPlayer);
79794 Main.projectile[num].ai[0] = 1f;
79795 SquareTileFrame(i, j);
79796 }
79797 if (Main.netMode == 2)
79798 {
79799 bool flag = false;
79800 for (int k = 0; k < 1000; k++)
79801 {
79802 if (Main.projectile[k].active && Main.projectile[k].owner == Main.myPlayer && Main.projectile[k].type == projType && Math.Abs(Main.projectile[k].timeLeft - 3600) < 60 && Main.projectile[k].Distance(new Vector2((float)(i * 16 + 8), (float)(j * 16 + 10))) < 4f)
79803 {
79804 flag = true;
79805 break;
79806 }
79807 }
79808 if (!flag)
79809 {
79810 int num2 = Projectile.NewProjectile(GetProjectileSource_TileBreak(i, j), i * 16 + 8, j * 16 + 8, 0f, 2.5f, projType, dmg, 0f, Main.myPlayer);
79811 Main.projectile[num2].velocity.Y = 0.5f;
79812 Main.projectile[num2].position.Y += 2f;
79813 Main.projectile[num2].netUpdate = true;
79814 }
79815 SquareTileFrame(i, j);
79816 NetMessage.SendTileSquare(-1, i, j);
79817 ExploitDestroyQueue.Enqueue(new Point(i, j));
79818 ExploitDestroyQueue.Enqueue(new Point(i, j - 1));
79819 }
79820 return true;
79821 }
static Queue< Point > ExploitDestroyQueue
Definition WorldGen.cs:1430
static bool BlockBelowMakesSandFall(int i, int j)
static void GetSandfallProjData(int type, out int projType, out int dmg)
static EntitySource_TileBreak GetProjectileSource_TileBreak(int x, int y)
Definition WorldGen.cs:1552
static void SquareTileFrame(int i, int j, bool resetFrame=true)
static bool AllowsSandfall(Tile tileTopCache)

References Terraria.Tile.ClearTile(), Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Projectile.NewProjectile(), Terraria.Main.projectile, and Terraria.NetMessage.SendTileSquare().

+ Here is the call graph for this function: