Fix stackable hideout crafts not being added to stash in correct format

This commit is contained in:
Dev 2024-02-02 17:31:52 +00:00
parent 83c3cd5f8b
commit ca02aa6a50

View File

@ -802,17 +802,17 @@ export class HideoutController
if (rewardIsStackable) if (rewardIsStackable)
{ {
// Create root item // Create root item
const rewardToAdd: Item[] = [{ const rewardToAdd: Item = {
_id: this.hashUtil.generate(), _id: this.hashUtil.generate(),
_tpl: recipe.endProduct, _tpl: recipe.endProduct,
upd: { upd: {
StackObjectsCount: recipe.count StackObjectsCount: recipe.count
} }
}]; };
// Split item into separate items with acceptable stack sizes // Split item into separate items with acceptable stack sizes
const splitReward = this.itemHelper.splitStack(rewardToAdd[0]); const splitReward = this.itemHelper.splitStackIntoSeparateItems(rewardToAdd);
itemAndChildrenToSendToPlayer.push(splitReward); itemAndChildrenToSendToPlayer.push(...splitReward);
} }
else else
{ {