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

◆ AddBuff_ActuallyTryToAddTheBuff()

bool Terraria.Player.AddBuff_ActuallyTryToAddTheBuff ( int type,
int time )
inlineprivate

Definition at line 4476 of file Player.cs.

4477 {
4478 int num = -1;
4479 while (num == -1)
4480 {
4481 int num2 = -1;
4482 for (int i = 0; i < maxBuffs; i++)
4483 {
4484 if (!Main.debuff[buffType[i]])
4485 {
4486 num2 = i;
4487 break;
4488 }
4489 }
4490 if (num2 == -1)
4491 {
4492 return false;
4493 }
4494 for (int j = num2; j < maxBuffs; j++)
4495 {
4496 if (buffType[j] == 0)
4497 {
4498 num = j;
4499 break;
4500 }
4501 }
4502 if (num == -1)
4503 {
4504 DelBuff(num2);
4505 }
4506 }
4507 buffType[num] = type;
4508 buffTime[num] = time;
4509 return true;
4510 }
static readonly int maxBuffs
Definition Player.cs:1191
void DelBuff(int b)
Definition Player.cs:4602

References Terraria.Player.buffTime, Terraria.Player.buffType, Terraria.Main.debuff, Terraria.Player.DelBuff(), Terraria.Player.maxBuffs, and System.type.

Referenced by Terraria.Player.AddBuff().