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

◆ dropItemCheck()

void Terraria.Player.dropItemCheck ( )
inline

Definition at line 5457 of file Player.cs.

5458 {
5459 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
5460 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
5461 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
5462 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
5463 //IL_0079: Unknown result type (might be due to invalid IL or missing references)
5464 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
5465 //IL_0298: Unknown result type (might be due to invalid IL or missing references)
5466 //IL_029d: Unknown result type (might be due to invalid IL or missing references)
5467 if (!Main.playerInventory)
5468 {
5469 noThrow = 0;
5470 }
5471 if (noThrow > 0)
5472 {
5473 noThrow--;
5474 }
5475 GetItemSettings getItemInDropItemCheck = GetItemSettings.GetItemInDropItemCheck;
5476 if (!Main.InGuideCraftMenu && Main.guideItem.type > 0)
5477 {
5478 Main.guideItem.position = base.Center;
5479 Item item = GetItem(whoAmI, Main.guideItem, getItemInDropItemCheck);
5480 if (item.stack > 0)
5481 {
5482 int num = Item.NewItem(new EntitySource_OverfullInventory(this), position, width, height, item, noBroadcast: false, noGrabDelay: true);
5483 Main.item[num].newAndShiny = false;
5484 if (Main.netMode == 1)
5485 {
5486 NetMessage.SendData(21, -1, -1, null, num, 1f);
5487 }
5488 }
5489 Main.guideItem = new Item();
5490 }
5491 if (!Main.InReforgeMenu && Main.reforgeItem.type > 0)
5492 {
5493 Main.reforgeItem.position = base.Center;
5494 Item item2 = GetItem(whoAmI, Main.reforgeItem, getItemInDropItemCheck);
5495 if (item2.stack > 0)
5496 {
5497 int num2 = Item.NewItem(new EntitySource_OverfullInventory(this), position, width, height, item2, noBroadcast: false, noGrabDelay: true);
5498 Main.item[num2].newAndShiny = false;
5499 if (Main.netMode == 1)
5500 {
5501 NetMessage.SendData(21, -1, -1, null, num2, 1f);
5502 }
5503 }
5504 Main.reforgeItem = new Item();
5505 }
5506 if (Main.myPlayer == whoAmI)
5507 {
5508 inventory[58] = Main.mouseItem.Clone();
5509 }
5510 bool flag = true;
5511 if (Main.mouseItem.type > 0 && Main.mouseItem.stack > 0)
5512 {
5513 if (!Main.gamePaused)
5514 {
5515 tileTargetX = (int)(((float)Main.mouseX + Main.screenPosition.X) / 16f);
5516 tileTargetY = (int)(((float)Main.mouseY + Main.screenPosition.Y) / 16f);
5517 if (gravDir == -1f)
5518 {
5519 tileTargetY = (int)((Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY) / 16f);
5520 }
5521 }
5522 if (selectedItem != 58)
5523 {
5525 }
5526 selectedItem = 58;
5527 flag = false;
5528 }
5529 if (flag && selectedItem == 58 && ItemTimeIsZero && itemAnimation == 0)
5530 {
5532 }
5533 if (Main.mouseItem.type > 0 && !Main.playerInventory)
5534 {
5535 Main.mouseItem.position = base.Center;
5536 Item item3 = GetItem(whoAmI, Main.mouseItem, getItemInDropItemCheck);
5537 if (item3.stack > 0)
5538 {
5539 int num3 = Item.NewItem(new EntitySource_OverfullInventory(this), (int)position.X, (int)position.Y, width, height, item3.type, item3.stack, noBroadcast: false, Main.mouseItem.prefix, noGrabDelay: true);
5540 Main.item[num3] = item3.Clone();
5541 Main.item[num3].newAndShiny = false;
5542 if (Main.netMode == 1)
5543 {
5544 NetMessage.SendData(21, -1, -1, null, num3, 1f);
5545 }
5546 }
5547 Main.mouseItem = new Item();
5548 inventory[58] = new Item();
5549 Recipe.FindRecipes();
5550 }
5551 if (((controlThrow && releaseThrow && !inventory[selectedItem].favorited && inventory[selectedItem].type > 0 && !Main.drawingPlayerChat) || (((Main.mouseRight && !mouseInterface && Main.mouseRightRelease) || !Main.playerInventory) && Main.mouseItem.type > 0 && Main.mouseItem.stack > 0)) && noThrow <= 0)
5552 {
5554 }
5555 if (Main.gamePaused && selectedItem == 58)
5556 {
5558 }
5559 }
Used when attempting to add an item to the player's inventory, but it cannot fit so it spawns in the ...
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
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
Item Clone()
Definition Item.cs:51739
Item GetItem(int plr, Item newItem, GetItemSettings settings)
Definition Player.cs:38131
bool ItemTimeIsZero
Definition Player.cs:4402
bool mouseInterface
Definition Player.cs:1616
bool controlThrow
Definition Player.cs:1908
bool releaseThrow
Definition Player.cs:1934
static int tileTargetY
Definition Player.cs:2652
static int tileTargetX
Definition Player.cs:2650
void DropSelectedItem()
Definition Player.cs:5561
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.Player.controlThrow, Terraria.Main.drawingPlayerChat, Terraria.Player.DropSelectedItem(), Terraria.Recipe.FindRecipes(), Terraria.Main.gamePaused, Terraria.Player.GetItem(), Terraria.GetItemSettings.GetItemInDropItemCheck, Terraria.Player.gravDir, Terraria.Main.guideItem, Terraria.Entity.height, Terraria.Main.InGuideCraftMenu, Terraria.Main.InReforgeMenu, Terraria.Player.inventory, Terraria.Main.item, Terraria.Player.itemAnimation, Terraria.Player.ItemTimeIsZero, Terraria.Player.mouseInterface, Terraria.Main.mouseItem, Terraria.Main.mouseRight, Terraria.Main.mouseRightRelease, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Player.noThrow, Terraria.Player.oldSelectItem, Terraria.Main.playerInventory, Terraria.Entity.position, Terraria.Main.reforgeItem, Terraria.Player.releaseThrow, Terraria.Main.screenPosition, Terraria.Player.selectedItem, Terraria.NetMessage.SendData(), Terraria.Item.stack, Terraria.Player.tileTargetX, Terraria.Player.tileTargetY, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.Update().

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