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

◆ TryDroppingSingleItem()

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

Definition at line 50859 of file Player.cs.

50860 {
50861 if (theItem.stack > 0)
50862 {
50863 int num = Item.NewItem(source, (int)position.X, (int)position.Y, width, height, theItem.type);
50864 Item obj = Main.item[num];
50865 obj.netDefaults(theItem.netID);
50866 obj.Prefix(theItem.prefix);
50867 obj.stack = theItem.stack;
50868 obj.velocity.Y = (float)Main.rand.Next(-20, 1) * 0.2f;
50869 obj.velocity.X = (float)Main.rand.Next(-20, 21) * 0.2f;
50870 obj.noGrabDelay = 100;
50871 obj.newAndShiny = false;
50872 if (Main.netMode == 1)
50873 {
50874 NetMessage.SendData(21, -1, -1, null, num);
50875 }
50876 }
50877 theItem.TurnToAir(fullReset: true);
50878 }
Vector2 position
Definition Entity.cs:14

References Terraria.Main.item, Terraria.Main.netMode, Terraria.Item.NewItem(), System.obj, Terraria.Main.rand, Terraria.NetMessage.SendData(), and System.source.

Referenced by Terraria.EquipmentLoadout.TryDroppingItems().