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

◆ KillOldestJavelin()

static void Terraria.Projectile.KillOldestJavelin ( int protectedProjectileIndex,
int projectileType,
int targetNPCIndex,
Point[] bufferForScan )
inlinestatic

Definition at line 13044 of file Projectile.cs.

13045 {
13046 int num = 0;
13047 for (int i = 0; i < 1000; i++)
13048 {
13049 if (i != protectedProjectileIndex && Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == projectileType && Main.projectile[i].ai[0] == 1f && Main.projectile[i].ai[1] == (float)targetNPCIndex)
13050 {
13051 bufferForScan[num++] = new Point(i, Main.projectile[i].timeLeft);
13052 if (num >= bufferForScan.Length)
13053 {
13054 break;
13055 }
13056 }
13057 }
13058 if (num < bufferForScan.Length)
13059 {
13060 return;
13061 }
13062 int num2 = 0;
13063 for (int j = 1; j < bufferForScan.Length; j++)
13064 {
13066 {
13067 num2 = j;
13068 }
13069 }
13070 Main.projectile[bufferForScan[num2].X].Kill();
13071 }

References Terraria.Main.myPlayer, Terraria.Main.projectile, and System.Y.

Referenced by Terraria.Player.BloodButcherer_TryButchering(), Terraria.Projectile.Damage(), and Terraria.Player.TentacleSpike_TrySpiking().