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

◆ ClearImmuneToBuffs()

void Terraria.NPC.ClearImmuneToBuffs ( out bool anyBuffsCleared)
inline

Definition at line 112687 of file NPC.cs.

112688 {
112689 anyBuffsCleared = false;
112690 for (int i = maxBuffs - 1; i >= 0; i--)
112691 {
112692 if (buffImmune[buffType[i]])
112693 {
112694 buffTime[i] = 0;
112695 buffType[i] = 0;
112696 anyBuffsCleared = true;
112697 }
112698 if (buffTime[i] == 0 || buffType[i] == 0)
112699 {
112700 for (int j = i + 1; j < maxBuffs; j++)
112701 {
112702 buffTime[j - 1] = buffTime[j];
112703 buffType[j - 1] = buffType[j];
112704 buffTime[j] = 0;
112705 buffType[j] = 0;
112706 }
112707 }
112708 }
112709 if (Main.netMode == 2)
112710 {
112711 NetMessage.SendData(54, -1, -1, null, whoAmI);
112712 }
112713 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
static readonly int maxBuffs
Definition NPC.cs:647
int[] buffTime
Definition NPC.cs:651
bool[] buffImmune
Contains the NPC buff immunities for this NPC. The default values in this array are populated from F:...
Definition NPC.cs:656
int[] buffType
Definition NPC.cs:649

References Terraria.Main.netMode, and Terraria.NetMessage.SendData().

+ Here is the call graph for this function: