edited March 25 in ORK Scripting
Hello,

I have item stacking set to Autostack and the inventory type to Group Inventory.

This is code I use to add item:
ItemShortcut _ItemShortcut = new ItemShortcut((int)Items[i].Item, Items[i].Quantity);
_ItemShortcut.Variables.Set("Variation", Items[i].VariationID);
_Player.Group.Inventory.AddAccess(_ItemShortcut, true, true, true);


But Autostacking is ignored and I get individual items. I debugged and in code InventoryCollection.cs AddToList function
if(items[i].IsEqual(shortcut))
does not fire, because shortcuts don't equal each other.

How can I fix this?

Could variable differences cause this?
Post edited by hellwalker on
  • Yes, if the variables are not equal, the items are not checking out as equal. Otherwise you'd lose the variables.

    An item stack is just an ItemShortcut with a quantity higher than 1, i.e. stacking just increases the quantity of an existing item and you'd lose any other information making it different, so you can only stack items with the same variables.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.