From d305e2cc7b16e1285d3b80de1d8c9ac826194d33 Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 23 Jan 2025 20:43:56 +0000 Subject: [PATCH] Updated `ApplyClothingItemToProfile` --- .../Controllers/CustomizationController.cs | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/Libraries/Core/Controllers/CustomizationController.cs b/Libraries/Core/Controllers/CustomizationController.cs index 23b85a48..dc864fe9 100644 --- a/Libraries/Core/Controllers/CustomizationController.cs +++ b/Libraries/Core/Controllers/CustomizationController.cs @@ -25,13 +25,16 @@ public class CustomizationController( ICloner _cloner ) { - /// - /// Get purchasable clothing items from trader that match players side (usec/bear) - /// - /// trader to look up clothing for - /// Session id - /// Suit array - public List GetTraderSuits(string traderId, string sessionId) + protected string _lowerParentClothingId = "5cd944d01388ce000a659df9"; + protected string _upperParentClothingId = "5cd944ca1388ce03a44dc2a4"; + +/// +/// Get purchasable clothing items from trader that match players side (usec/bear) +/// +/// trader to look up clothing for +/// Session id +/// Suit array +public List GetTraderSuits(string traderId, string sessionId) { var pmcData = _profileHelper.GetPmcProfile(sessionId); var clothing = _databaseService.GetCustomization(); @@ -104,6 +107,7 @@ public class CustomizationController( Source = CustomisationSource.UNLOCKED_IN_GAME, Type = CustomisationType.SUITE }; + profile.CustomisationUnlocks.Add(rewardToStore); return output; @@ -314,20 +318,19 @@ public class CustomizationController( return; } - switch (dbSuit.Parent) + // Body + if (dbSuit.Parent == _upperParentClothingId) { - case "5cd944d01388ce000a659df9": - if (pmcData.Customization is null) return; + pmcData.Customization.Body = dbSuit.Properties.Body; + pmcData.Customization.Hands = dbSuit.Properties.Hands; - pmcData.Customization.Body = dbSuit.Properties?.Body; - pmcData.Customization.Hands = dbSuit.Properties?.Hands; + return; + } - return; - case "5cd944ca1388ce03a44dc2a4": - if (pmcData.Customization is null) return; - - pmcData.Customization.Feet = dbSuit.Properties?.Feet; - break; + // Feet + if (dbSuit.Parent == _lowerParentClothingId) + { + pmcData.Customization.Feet = dbSuit.Properties.Feet; } } }