Correctly supply ID of voice not name of voice when generating bot
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user