diff --git a/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs index 981067b61..8a9e20f37 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/QuestHelper.cs @@ -1,3 +1,4 @@ +using System.Text.Json; using SPTarkov.Server.Core.Models.Eft.Common; using SPTarkov.Server.Core.Models.Eft.Common.Tables; using SPTarkov.Server.Core.Models.Eft.ItemEvent; @@ -193,7 +194,8 @@ public string GetQuestNameFromLocale(string questId) /// true if loyalty is high enough to fulfill quest requirement public bool TraderLoyaltyLevelRequirementCheck(QuestCondition questProperties, PmcData profile) { - var requiredLoyaltyLevel = questProperties.Value as double?; + var value = (JsonElement)questProperties.Value; + var requiredLoyaltyLevel = value.GetDouble(); if (!profile.TradersInfo.TryGetValue( questProperties.Target.IsItem ? questProperties.Target.Item @@ -208,7 +210,7 @@ out var trader return CompareAvailableForValues( trader.LoyaltyLevel.Value, - requiredLoyaltyLevel.Value, + requiredLoyaltyLevel, questProperties.CompareMethod ); }