From d7b316fa421be02b7a8c4701bb166d2be9e56444 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 27 Jan 2025 11:31:12 +0000 Subject: [PATCH] Get size of static loot item - take into account items with children may be larger with attachments --- Libraries/Core/Generators/LocationLootGenerator.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Libraries/Core/Generators/LocationLootGenerator.cs b/Libraries/Core/Generators/LocationLootGenerator.cs index 211b4239..0dd04a97 100644 --- a/Libraries/Core/Generators/LocationLootGenerator.cs +++ b/Libraries/Core/Generators/LocationLootGenerator.cs @@ -436,8 +436,9 @@ public class LocationLootGenerator( var items = _locationConfig.TplsToStripChildItemsFrom.Contains(tplToAdd) ? [chosenItemWithChildren.Items[0]] // Strip children from parent : chosenItemWithChildren.Items; - var width = chosenItemWithChildren.Width; - var height = chosenItemWithChildren.Height; + var itemSize = GetItemSize(items); + var width = itemSize.Width; + var height = itemSize.Height; // look for open slot to put chosen item into var result = _containerHelper.FindSlotForItem(containerMap, (int)width, (int)height); @@ -498,7 +499,7 @@ public class LocationLootGenerator( } - // Multi-mod-item, use helper to get size of item + mods + // Multi-mod-item, use helper to get size of item + attached mods var result = _inventoryHelper.GetItemSize(rootItem.Template, rootItem.Id, items); return new ItemSize {