From 4f22d6a11e35378ac8431a4733bfde6c89783bfb Mon Sep 17 00:00:00 2001 From: punchready <22683812+punchready@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:29:46 +0100 Subject: [PATCH 1/2] Fix item giving Previously this would potentially drop too many items on the ground if the inventory doesn't have enough free slots. --- TShockAPI/TSPlayer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 495d24a7..244914b6 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1556,8 +1556,8 @@ namespace TShockAPI if (Depleted(item = GiveItemDirectly_FillEmptyInventorySlot(item, slot))) return; - // oh no, i can't give... guess i gotta spill it on the floor - GiveItemByDrop(type, stack, prefix); + // oh no, i can't give the rest of the items... guess i gotta spill it on the floor + GiveItemByDrop(item.type, item.stack, item.prefix); } private void SendItemSlotPacketFor(int slot) From bfd665bcb520529d22c2db0c6d2a3c8e5700ce56 Mon Sep 17 00:00:00 2001 From: punchready <22683812+punchready@users.noreply.github.com> Date: Tue, 1 Nov 2022 01:32:28 +0100 Subject: [PATCH 2/2] Update changelog --- docs/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 58ff73d6..8006ff29 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -15,7 +15,7 @@ Use past tense when adding new entries; sign your name off when you add or chang * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. --> ## Upcoming changes -* Your changes could and should be here! +* Fixed item giving potentially dropping too many items (@PotatoCider, @punchready) ## TShock 5.0.0 * Reduced load/save console spam. (@SignatureBeef, @YehnBeep)