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

◆ GetItem_FillIntoOccupiedSlot_VoidBag()

bool Terraria.Player.GetItem_FillIntoOccupiedSlot_VoidBag ( int plr,
Item[] inv,
Item newItem,
GetItemSettings settings,
Item returnItem,
int i )
inlineprivate

Definition at line 37243 of file Player.cs.

37244 {
37245 if (inv[i].type > 0 && inv[i].stack < inv[i].maxStack && returnItem.IsTheSameAs(inv[i]))
37246 {
37247 if (newItem.IsACoin)
37248 {
37249 SoundEngine.PlaySound(38, (int)position.X, (int)position.Y);
37250 }
37251 else
37252 {
37253 SoundEngine.PlaySound(7, (int)position.X, (int)position.Y);
37254 }
37255 if (returnItem.stack + inv[i].stack <= inv[i].maxStack)
37256 {
37257 inv[i].stack += returnItem.stack;
37258 if (!settings.NoText)
37259 {
37260 PopupText.NewText(PopupTextContext.ItemPickupToVoidContainer, newItem, returnItem.stack, noStack: false, settings.LongText);
37261 }
37263 settings.HandlePostAction(inv[i]);
37264 return true;
37265 }
37266 AchievementsHelper.NotifyItemPickup(this, returnItem, inv[i].maxStack - inv[i].stack);
37267 returnItem.stack -= inv[i].maxStack - inv[i].stack;
37268 if (!settings.NoText)
37269 {
37270 PopupText.NewText(PopupTextContext.ItemPickupToVoidContainer, newItem, inv[i].maxStack - inv[i].stack, noStack: false, settings.LongText);
37271 }
37272 inv[i].stack = inv[i].maxStack;
37273 settings.HandlePostAction(inv[i]);
37274 }
37275 return false;
37276 }
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 position
Definition Entity.cs:14
static void NotifyItemPickup(Player player, Item item)

References Terraria.GetItemSettings.HandlePostAction(), Terraria.GetItemSettings.LongText, Terraria.PopupText.NewText(), Terraria.GetItemSettings.NoText, Terraria.GameContent.Achievements.AchievementsHelper.NotifyItemPickup(), Terraria.Audio.SoundEngine.PlaySound(), and System.type.