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

◆ CheckActive_WormSegments()

void Terraria.NPC.CheckActive_WormSegments ( )
inlineprivate

Definition at line 83613 of file NPC.cs.

83614 {
83615 if (aiStyle != 6)
83616 {
83617 return;
83618 }
83619 int num = (int)ai[0];
83620 while (num != whoAmI && num > 0 && num < 200)
83621 {
83622 NPC nPC = Main.npc[num];
83623 if (nPC.active && nPC.aiStyle == 6)
83624 {
83625 nPC.active = false;
83626 if (Main.netMode == 2)
83627 {
83628 nPC.life = 0;
83629 nPC.netSkip = -1;
83630 NetMessage.SendData(23, -1, -1, null, num);
83631 }
83632 num = (int)nPC.ai[0];
83633 continue;
83634 }
83635 break;
83636 }
83637 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla NPC AI styles are enumerated in the T:Te...
Definition NPC.cs:1013
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997

References Terraria.NPC.ai, Terraria.NPC.aiStyle, Terraria.Main.netMode, Terraria.Main.npc, Terraria.NetMessage.SendData(), and Terraria.Entity.whoAmI.

Referenced by Terraria.NPC.CheckActive().

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