diff --git a/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs index 171baca7..5c158679 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/LocationLootGenerator.cs @@ -467,7 +467,7 @@ public class LocationLootGenerator( var items = _locationConfig.TplsToStripChildItemsFrom.Contains(tplToAdd) ? [chosenItemWithChildren.Items[0]] // Strip children from parent : chosenItemWithChildren.Items; - var itemSize = GetItemSize(items); + var itemSize = _itemHelper.GetItemSize(items, items[0].Id); var itemWidth = itemSize.Width; var itemHeight = itemSize.Height; @@ -513,42 +513,6 @@ public class LocationLootGenerator( return containerClone; } - /// - /// Get the height/width of an item including its children - /// - /// - /// - protected ItemSize? GetItemSize(List? items) - { - var rootItem = items[0]; - if (items.Count == 1) - { - var itemTemplate = _itemHelper.GetItem(rootItem.Template).Value; - if (itemTemplate.Properties is null) - { - _logger.Error($"Unable to process item: {rootItem.Template}. it lacks _props"); - - return null; - } - - // Single item, get items properties - return new ItemSize - { - Width = itemTemplate.Properties.Width.Value, - Height = itemTemplate.Properties.Height.Value - }; - } - - - // Multi-mod-item, use helper to get size of item + attached mods - var result = _inventoryHelper.GetItemSize(rootItem.Template, rootItem.Id, items); - return new ItemSize - { - Width = result[0], - Height = result[1] - }; - } - /// /// Look up a containers itemcountDistribution data and choose an item count based on the found weights ///