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

◆ QuickMount_GetItemToUse()

Item Terraria.Player.QuickMount_GetItemToUse ( )
inline

Definition at line 6465 of file Player.cs.

6466 {
6467 Item item = null;
6468 bool equippedMountSufficient = false;
6469 if (item == null && miscEquips[3].mountType != -1 && !MountID.Sets.Cart[miscEquips[3].mountType])
6470 {
6472 }
6474 {
6475 item = miscEquips[3];
6476 }
6477 if (item == null)
6478 {
6479 for (int i = 0; i < 58; i++)
6480 {
6481 if (inventory[i].mountType != -1 && !MountID.Sets.Cart[inventory[i].mountType] && CombinedHooks.CanUseItem(this, inventory[i]))
6482 {
6483 item = inventory[i];
6484 break;
6485 }
6486 }
6487 }
6488 return item;
6489 }
static bool[] Cart
If true for a given T:Terraria.ID.MountID, then that mount is categorized as a minecart....
Definition MountID.cs:16
int mountType
Specifies which mount to equip when the item is used. Assign to ModContent.MountType<ModdedMountHere>...
Definition Item.cs:696
static bool CanUseItem(Player player, Item item)
Item[] miscEquips
The player's equipment items. From indexes 0-4: Pet, Light Pet, Minecart, Mount, and Hook.
Definition Player.cs:1658
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767

References Terraria.ModLoader.CombinedHooks.CanUseItem(), Terraria.ID.MountID.Sets.Cart, Terraria.Player.inventory, Terraria.Player.miscEquips, and Terraria.Item.mountType.

Referenced by Terraria.Player.QuickMount(), and Terraria.GameContent.ChromaHotkeyPainter.Step_Mount().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: