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

◆ GetAvailableAmountOfNPCsToSpawnUpToSlot()

static int Terraria.NPC.GetAvailableAmountOfNPCsToSpawnUpToSlot ( int amountWeWant,
int highestNPCSlotIndexWeWillPick = 100 )
inlinestatic

Definition at line 91123 of file NPC.cs.

91124 {
91125 if (amountWeWant <= 0)
91126 {
91127 return 0;
91128 }
91129 int num = 0;
91130 for (int i = 0; i < highestNPCSlotIndexWeWillPick; i++)
91131 {
91132 if (!Main.npc[i].active)
91133 {
91134 num++;
91135 if (num >= amountWeWant)
91136 {
91137 return amountWeWant;
91138 }
91139 }
91140 }
91141 return num;
91142 }

References Terraria.Main.npc.

Referenced by Terraria.WorldGen.CheckSuper(), Terraria.Item.GetShimmered(), and Terraria.Projectile.Kill().

+ Here is the caller graph for this function: