From ecf9540514196a7f088013d82d1b62f5e83fd31f Mon Sep 17 00:00:00 2001 From: CWX Date: Sat, 1 Feb 2025 17:02:10 +0000 Subject: [PATCH] do tryadd for insurance cost (cant have more than one of the same tpl), client handles multiple items being the same --- Libraries/Core/Controllers/InsuranceController.cs | 2 +- Libraries/Core/Generators/LocationLootGenerator.cs | 2 +- Libraries/Core/Helpers/InventoryHelper.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/Core/Controllers/InsuranceController.cs b/Libraries/Core/Controllers/InsuranceController.cs index 45f2e583..1c69eef8 100644 --- a/Libraries/Core/Controllers/InsuranceController.cs +++ b/Libraries/Core/Controllers/InsuranceController.cs @@ -768,7 +768,7 @@ public class InsuranceController( continue; } - items.Add( + items.TryAdd( inventoryItemsHash[itemId].Template, _insuranceService.GetRoublePriceToInsureItemWithTrader(pmcData, inventoryItemsHash[itemId], trader) ); diff --git a/Libraries/Core/Generators/LocationLootGenerator.cs b/Libraries/Core/Generators/LocationLootGenerator.cs index 19e82df9..cd6d3539 100644 --- a/Libraries/Core/Generators/LocationLootGenerator.cs +++ b/Libraries/Core/Generators/LocationLootGenerator.cs @@ -175,7 +175,7 @@ public class LocationLootGenerator( { if(_logger.IsLogEnabled(LogLevel.Debug)) { - _logger.Debug($"`Group: {key} has no containers with< 100 % spawn chance to choose from, skipping"); + _logger.Debug($"Group: {key} has no containers with < 100 % spawn chance to choose from, skipping"); } continue; diff --git a/Libraries/Core/Helpers/InventoryHelper.cs b/Libraries/Core/Helpers/InventoryHelper.cs index afa0c7cc..a8f4528a 100644 --- a/Libraries/Core/Helpers/InventoryHelper.cs +++ b/Libraries/Core/Helpers/InventoryHelper.cs @@ -1080,7 +1080,7 @@ public class InventoryHelper( if (_logger.IsLogEnabled(LogLevel.Debug)) { _logger.Debug( - $"{moveRequest.Action} item: ${moveRequest.Item} from slotid: {matchingInventoryItem.SlotId} to container: {moveRequest.To.Container}" + $"{moveRequest.Action} item: {moveRequest.Item} from slotid: {matchingInventoryItem.SlotId} to container: {moveRequest.To.Container}" ); }