Terraria.Player.DelBuff C# (CSharp) Method

DelBuff() public method

public DelBuff ( int b ) : void
b int
return void
        public void DelBuff(int b)
        {
            this.buffTime[b] = 0;
            this.buffType[b] = 0;
            for (int index1 = 0; index1 < 21; ++index1)
            {
                if (this.buffTime[index1] == 0 || this.buffType[index1] == 0)
                {
                    for (int index2 = index1 + 1; index2 < 22; ++index2)
                    {
                        this.buffTime[index2 - 1] = this.buffTime[index2];
                        this.buffType[index2 - 1] = this.buffType[index2];
                        this.buffTime[index2] = 0;
                        this.buffType[index2] = 0;
                    }
                }
            }
        }

Usage Example

Example #1
0
 public void OnPlayerUpdateBuffs(Player player)
 {
     foreach (var type in buffs)
     {
         var index = player.HasBuff(type);
         if (index >= 0)
             player.DelBuff(index);
         player.buffImmune[type] = true;
     }
 }
All Usage Examples Of Terraria.Player::DelBuff
Player