Description
Describe the issue
If using the "manual stack split" behavior in the inventory, necessary attributes for custom/modded items outside the vanilla items won't be carried over properly or at all.
This causes functions for the child stack to no longer work, such as not being able to be restacked with the original parent stack (or any other stack for that matter.) of otherwise identical items. As well as breaking any additional functionality that custom item may have had, such as any "OnUse" functions attached to it normally.
To Reproduce
Have any mod that adds custom items that also stack. When you manually split said stack, the child will no longer function properly, as a result of the "className" attribute now being "null" when looking at the save-data for said child item stack.
Proposed Solution
I think the best way to potentially correct this behavior would be to simply update the "SplitStack" method's current way it recreates the child stack to use the ItemBuilder class' method "CreateItem" rather than how it currently does it.
Specifically changing this:
DaggerfallUnityItem pickedItems = new DaggerfallUnityItem(stack);
To This:
DaggerfallUnityItem pickedItems = ItemBuilder.CreateItem(stack.ItemGroup, stack.TemplateIndex);