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

◆ DelBuff()

void Terraria.Player.DelBuff ( int b)
inline

Removes the buff at the provided index in F:Terraria.Player.buffType and F:Terraria.Player.buffTime and shuffles the remaining buff indexes down to fill the gap. Use M:Terraria.Player.ClearBuff(System.Int32) if you only know the T:Terraria.ID.BuffID.

Parameters
bThe index in F:Terraria.Player.buffType of the buff to remove.

Definition at line 5868 of file Player.cs.

5869 {
5870 buffTime[b] = 0;
5871 buffType[b] = 0;
5872 int num = 0;
5873 for (int i = 0; i < maxBuffs - 1; i++)
5874 {
5875 if (buffTime[i] != 0 && buffType[i] != 0)
5876 {
5877 if (num < i)
5878 {
5879 buffTime[num] = buffTime[i];
5880 buffType[num] = buffType[i];
5881 buffTime[i] = 0;
5882 buffType[i] = 0;
5883 }
5884 num++;
5885 }
5886 }
5887 }
int[] buffTime
The remaining durations in ticks of all buffs this player has active. A value of 0 means that buff ...
Definition Player.cs:1692
int[] buffType
The T:Terraria.ID.BuffIDs of all buffs this player has active. A value of 0 means that buff slot is...
Definition Player.cs:1684
static int maxBuffs
Definition Player.cs:3380

References Terraria.Player.buffTime, Terraria.Player.buffType, and Terraria.Player.maxBuffs.

Referenced by Terraria.Player.AddBuff(), Terraria.Player.AddBuff_ActuallyTryToAddTheBuff(), Terraria.Player.AddBuff_RemoveOldMeleeBuffsOfMatchingType(), Terraria.Player.AddBuff_RemoveOldPetBuffsOfMatchingType(), Terraria.Player.ClearBuff(), Terraria.Player.ConsumeSolarFlare(), Terraria.Player.ItemCheck_ApplyPetBuffs(), Terraria.Player.NebulaLevelup(), Terraria.Player.OnHurt_Part1(), Terraria.Player.OnHurt_Part2(), Terraria.Player.ShadowDodge(), Terraria.Player.TryToPoop(), Terraria.Player.Update(), Terraria.Player.UpdateArmorSets(), and Terraria.Player.UpdateBuffs().

+ Here is the caller graph for this function: