From 9f3a50c3361020c0fb2611b6348e100459b3d55d Mon Sep 17 00:00:00 2001 From: CWX Date: Sat, 1 Feb 2025 21:03:25 +0000 Subject: [PATCH] fix sending changes to client, Live doesnt do this. null guard --- Libraries/Core/Helpers/InventoryHelper.cs | 1 - Libraries/Core/Services/BotEquipmentFilterService.cs | 2 +- Libraries/Core/Services/CircleOfCultistService.cs | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Libraries/Core/Helpers/InventoryHelper.cs b/Libraries/Core/Helpers/InventoryHelper.cs index a8f4528a..b7f5333a 100644 --- a/Libraries/Core/Helpers/InventoryHelper.cs +++ b/Libraries/Core/Helpers/InventoryHelper.cs @@ -472,7 +472,6 @@ public class InventoryHelper( var insuredItems = profile.InsuredItems; // We have output object, inform client of root item deletion, not children - if (output is not null) output.ProfileChanges[sessionId].Items.DeletedItems.Add(new Item { Id = itemId }); foreach (var item in itemAndChildrenToRemove) { diff --git a/Libraries/Core/Services/BotEquipmentFilterService.cs b/Libraries/Core/Services/BotEquipmentFilterService.cs index 299c8535..eb30fb0f 100644 --- a/Libraries/Core/Services/BotEquipmentFilterService.cs +++ b/Libraries/Core/Services/BotEquipmentFilterService.cs @@ -429,7 +429,7 @@ public class BotEquipmentFilterService foreach (var itemToEditKvP in poolAdjustmentKvP.Value) { // Only make change if item exists as we're editing, not adding - if (locationToUpdate[itemToEditKvP.Key] != null || locationToUpdate[itemToEditKvP.Key] == 0) + if (locationToUpdate.GetValueOrDefault(itemToEditKvP.Key) != null || locationToUpdate[itemToEditKvP.Key] == 0) { locationToUpdate[itemToEditKvP.Key] = itemToEditKvP.Value; } diff --git a/Libraries/Core/Services/CircleOfCultistService.cs b/Libraries/Core/Services/CircleOfCultistService.cs index 271fca6e..4853c9d2 100644 --- a/Libraries/Core/Services/CircleOfCultistService.cs +++ b/Libraries/Core/Services/CircleOfCultistService.cs @@ -923,7 +923,6 @@ public class CircleOfCultistService( CircleOfCultistSlotId ); // Add item + mods to output and profile inventory - output.ProfileChanges[sessionId].Items.NewItems.AddRange(itemToAdd); pmcData.Inventory.Items.AddRange(itemToAdd); } }