Skip to content

Commit 77791a9

Browse files
committed
Optimizations and version bump.
1 parent 28dc4bf commit 77791a9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

StackSizeController.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Oxide.Plugins
99
{
10-
[Info("Stack Size Controller", "AnExiledGod", "3.3.1")]
10+
[Info("Stack Size Controller", "AnExiledGod", "3.4.0")]
1111
[Description("Allows configuration of most items max stack size.")]
1212
class StackSizeController : CovalencePlugin
1313
{
@@ -646,6 +646,7 @@ object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer,
646646
}
647647

648648
Item targetItem = playerLoot.FindContainer(targetContainer).GetSlot(targetSlot);
649+
ItemContainer container = playerLoot.FindContainer(targetContainer);
649650

650651
if (targetItem.IsNull<Item>())
651652
{
@@ -658,7 +659,7 @@ object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer,
658659
{
659660
if (containedItem.info.itemType == ItemContainer.ContentsType.Liquid) { continue; }
660661

661-
playerLoot.FindContainer(targetContainer).AddItem(containedItem.info, containedItem.amount, containedItem.skin);
662+
container.AddItem(containedItem.info, containedItem.amount, containedItem.skin);
662663
containedItem.Remove();
663664
}
664665
}
@@ -670,7 +671,7 @@ object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer,
670671
{
671672
if (containedItem.info.itemType == ItemContainer.ContentsType.Liquid) { continue; }
672673

673-
playerLoot.FindContainer(targetContainer).AddItem(containedItem.info, containedItem.amount, containedItem.skin);
674+
container.AddItem(containedItem.info, containedItem.amount, containedItem.skin);
674675
containedItem.Remove();
675676
}
676677
}
@@ -683,7 +684,7 @@ object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer,
683684
{
684685
if (itemMag.contents > 0)
685686
{
686-
playerLoot.FindContainer(targetContainer).AddItem(itemMag.ammoType, itemMag.contents);
687+
container.AddItem(itemMag.ammoType, itemMag.contents);
687688

688689
itemMag.contents = 0;
689690
}
@@ -695,7 +696,7 @@ object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer,
695696

696697
if (flameThrower.ammo > 0)
697698
{
698-
playerLoot.FindContainer(targetContainer).AddItem(flameThrower.fuelType, flameThrower.ammo);
699+
container.AddItem(flameThrower.fuelType, flameThrower.ammo);
699700

700701
flameThrower.ammo = 0;
701702
}
@@ -707,7 +708,7 @@ object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer,
707708

708709
if (chainsaw.ammo > 0)
709710
{
710-
playerLoot.FindContainer(targetContainer).AddItem(chainsaw.fuelType, chainsaw.ammo);
711+
container.AddItem(chainsaw.fuelType, chainsaw.ammo);
711712

712713
chainsaw.ammo = 0;
713714
}

0 commit comments

Comments
 (0)