Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ HasAmmo()

bool Terraria.Player.HasAmmo ( Item sItem,
bool canUse )
inline

Definition at line 49951 of file Player.cs.

49952 {
49953 if (sItem.useAmmo > 0)
49954 {
49955 canUse = false;
49956 for (int i = 0; i < 58; i++)
49957 {
49958 if (inventory[i].ammo == sItem.useAmmo && inventory[i].stack > 0)
49959 {
49960 canUse = true;
49961 break;
49962 }
49963 }
49964 }
49965 return canUse;
49966 }
int stack
Definition Item.cs:149
Item[] inventory
Definition Player.cs:1257

References Terraria.Item.stack.

Referenced by Terraria.Projectile.AI_075().