diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs index 090dddeb..eaa3eb0f 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotGenerator.cs @@ -272,9 +272,15 @@ public class BotGenerator( ); bot.Info.Settings.UseSimpleAnimator = botJsonTemplate.BotExperience.UseSimpleAnimator ?? false; - bot.Customization.Voice = weightedRandomHelper.GetWeightedValue( + var chosenVoiceName = weightedRandomHelper.GetWeightedValue( botJsonTemplate.BotAppearance.Voice ); + bot.Customization.Voice = databaseService + .GetCustomization() + .FirstOrDefault(customisation => + customisation.Value.Name.Equals(chosenVoiceName, StringComparison.OrdinalIgnoreCase) + ) + .Key; bot.Health = GenerateHealth( botJsonTemplate.BotHealth, botGenerationDetails.IsPlayerScav.GetValueOrDefault(false) diff --git a/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs b/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs index 404da1a2..eb602308 100644 --- a/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs @@ -61,7 +61,7 @@ public class CreateProfileService( pmcData.Info.Nickname = request.Nickname; pmcData.Info.LowerNickname = request.Nickname.ToLowerInvariant(); pmcData.Info.RegistrationDate = (int)timeUtil.GetTimeStamp(); - pmcData.Customization.Voice = databaseService.GetCustomization()[request.VoiceId].Name; + pmcData.Customization.Voice = databaseService.GetCustomization()[request.VoiceId].Id; pmcData.Stats = profileHelper.GetDefaultCounters(); pmcData.Info.NeedWipeOptions = []; pmcData.Customization.Head = request.HeadId;