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

◆ HasAmmo() [2/2]

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

Definition at line 53979 of file Player.cs.

53980 {
53981 if (!canUse)
53982 {
53983 return false;
53984 }
53985 if (sItem.useAmmo != 0 && ChooseAmmo(sItem) == null)
53986 {
53987 return !ItemLoader.NeedsAmmo(sItem, this);
53988 }
53989 return true;
53990 }
static bool NeedsAmmo(Item weapon, Player player)
Calls ModItem.NeedsAmmo, then all GlobalItem.NeedsAmmo hooks, until any of them returns false.
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
Item ChooseAmmo(Item weapon)
Attempts to select an ammo item stack from this player's inventory to shoot with the given weapon.
Definition Player.cs:54039

References Terraria.Player.ChooseAmmo(), and Terraria.ModLoader.ItemLoader.NeedsAmmo().

+ Here is the call graph for this function: