Fix rusty gear item stack not updating client side

Part of #6
This commit is contained in:
zontreck 2025-06-07 13:18:21 -07:00
parent 6b6e2af0fc
commit 8d875653e0
4 changed files with 11 additions and 6 deletions

View file

@ -73,12 +73,17 @@ public static class RustyGearUtils
int amountToRemove = Math.Min(value, amount);
// If the slot size is less than or equal to the amount to remove, set the slot's itemstack to null
if (slot.StackSize <= amountToRemove) slot.Itemstack = null;
if (slot.StackSize <= amountToRemove)
{
slot.Itemstack = null;
slot.MarkDirty();
}
else
{
// Otherwise, subtract the amount to remove from the slot size and decrement the total amount
slot.Itemstack.StackSize -= amountToRemove;
amount -= amountToRemove;
slot.MarkDirty();
}
}