generated from AriasCreations/vsmodtemplate
parent
6b6e2af0fc
commit
8d875653e0
4 changed files with 11 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue