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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user