Fix insurance removes stored item and fix drawn element not being removed (#639)

* Exclude items stored inside root item (e.g. armored rigs) when processing regular items

* Remove draw element when whitelist is null

* Simplify null check
This commit is contained in:
ozen-m
2025-10-20 11:23:31 +08:00
committed by GitHub
parent 9db19aa730
commit ab62b070a8
2 changed files with 2 additions and 2 deletions
@@ -402,7 +402,7 @@ public class InsuranceController(
if (parentAttachmentsMap.ContainsKey(insuredItem.Id))
{
// This call will also return the parent item itself, queueing it for deletion as well.
var itemAndChildren = insured.Items.GetItemWithChildren(insuredItem.Id);
var itemAndChildren = insured.Items.GetItemWithChildren(insuredItem.Id, true);
foreach (var item in itemAndChildren)
{
toDelete.Add(item.Id);
@@ -226,7 +226,7 @@ public class ProbabilityObjectArray<K, V> : List<ProbabilityObject<K, V>>
drawnKeys.Add(chosenItem.Key);
// Only remove item if it's not in whitelist
if (neverRemoveWhitelist is not null && !neverRemoveWhitelist.Contains(chosenItem.Key))
if (neverRemoveWhitelist is null || !neverRemoveWhitelist.Contains(chosenItem.Key))
{
// Reduce total weight value by items weight + Remove item from pool
totalWeight -= chosenItem.Weight;