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

◆ TryDroppingSingleItem()

void Terraria.Player.TryDroppingSingleItem ( IEntitySource source,
Item theItem )
inline

Definition at line 55018 of file Player.cs.

55019 {
55020 if (theItem.stack > 0)
55021 {
55022 int num = Item.NewItem(source, (int)position.X, (int)position.Y, width, height, theItem);
55023 Item obj = Main.item[num];
55024 obj.velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
55025 obj.velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f;
55026 obj.noGrabDelay = 100;
55027 obj.newAndShiny = false;
55028 if (Main.netMode == 1)
55029 {
55030 NetMessage.SendData(21, -1, -1, null, num);
55031 }
55032 }
55033 theItem.TurnToAir(fullReset: true);
55034 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51

References Terraria.Entity.height, Terraria.Main.item, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Entity.position, Terraria.Main.rand, Terraria.NetMessage.SendData(), and Terraria.Entity.width.

Referenced by Terraria.Player.DropItems(), and Terraria.EquipmentLoadout.TryDroppingItems().

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