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

◆ CountItem()

int Terraria.Player.CountItem ( int type,
int stopCountingAt = 0 )
inline

Definition at line 8497 of file Player.cs.

8498 {
8499 int num = 0;
8500 for (int i = 0; i != 58; i++)
8501 {
8502 if (inventory[i].stack > 0 && inventory[i].type == type)
8503 {
8504 num += inventory[i].stack;
8505 if (num >= stopCountingAt)
8506 {
8507 return num;
8508 }
8509 }
8510 }
8511 return num;
8512 }
int stack
Definition Item.cs:149
Item[] inventory
Definition Player.cs:1257

References Terraria.Item.stack, and System.type.