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

◆ QuickMount()

void Terraria.Player.QuickMount ( )
inline

Definition at line 6299 of file Player.cs.

6300 {
6301 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
6302 if (mount.Active)
6303 {
6304 mount.Dismount(this);
6305 }
6306 else
6307 {
6308 if (frozen || tongued || webbed || stoned || gravDir == -1f || dead || noItems)
6309 {
6310 return;
6311 }
6312 Item item = QuickMount_GetItemToUse();
6313 if (item != null && item.mountType != -1 && mount.CanMount(item.mountType, this) && ItemCheck_CheckCanUse(item))
6314 {
6315 if (!QuickMinecartSnap())
6316 {
6317 mount.SetMount(item.mountType, this);
6318 ItemLoader.UseItem(item, this);
6319 if (item.UseSound.HasValue)
6320 {
6321 SoundEngine.PlaySound(item.UseSound, base.Center);
6322 }
6323 }
6324 }
6325 else
6326 {
6327 QuickMinecart();
6328 }
6329 }
6330 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static ? bool UseItem(Item item, Player player)
Returns false if any of ModItem.UseItem or GlobalItem.UseItem return false. Returns true if anything ...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
void Dismount(Player mountedPlayer)
Definition Mount.cs:6357
bool CanMount(int m, Player mountingPlayer)
Definition Mount.cs:6652
bool Active
Definition Mount.cs:348
void SetMount(int m, Player mountedPlayer, bool faceLeft=false)
Definition Mount.cs:6395
bool ItemCheck_CheckCanUse(Item sItem)
Definition Player.cs:52757
Mount mount
This player's T:Terraria.Mount. Do not overwrite this value. Instead, call M:Terraria....
Definition Player.cs:2323
bool QuickMinecartSnap()
Definition Player.cs:6407
void QuickMinecart()
Definition Player.cs:6343
Item QuickMount_GetItemToUse()
Definition Player.cs:6465

References Terraria.Mount.Active, Terraria.Mount.CanMount(), Terraria.Player.dead, Terraria.Mount.Dismount(), Terraria.Player.frozen, Terraria.Player.gravDir, Terraria.Player.ItemCheck_CheckCanUse(), Terraria.Player.mount, Terraria.Item.mountType, Terraria.Player.noItems, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Player.QuickMinecart(), Terraria.Player.QuickMinecartSnap(), Terraria.Player.QuickMount_GetItemToUse(), Terraria.Mount.SetMount(), Terraria.Player.stoned, Terraria.Player.tongued, Terraria.ModLoader.ItemLoader.UseItem(), Terraria.Item.UseSound, and Terraria.Player.webbed.

Referenced by Terraria.Player.Update().

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