Fix item giving

Previously this would potentially drop too many items on the ground if the inventory doesn't have enough free slots.
This commit is contained in:
punchready 2022-11-01 01:29:46 +01:00 committed by GitHub
parent 1baad06484
commit 4f22d6a11e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1556,8 +1556,8 @@ namespace TShockAPI
if (Depleted(item = GiveItemDirectly_FillEmptyInventorySlot(item, slot))) if (Depleted(item = GiveItemDirectly_FillEmptyInventorySlot(item, slot)))
return; return;
// oh no, i can't give... guess i gotta spill it on the floor // oh no, i can't give the rest of the items... guess i gotta spill it on the floor
GiveItemByDrop(type, stack, prefix); GiveItemByDrop(item.type, item.stack, item.prefix);
} }
private void SendItemSlotPacketFor(int slot) private void SendItemSlotPacketFor(int slot)